Errm, so your using Excel as your datase, then via VBA are generating some SQL, which you pass through to SAS to create something, which then passes back to Excel? That sounds a bit over complex. Can you not agree on one technology, for example:
Use SAS to do things then export a final report to Excel.
Import all data to a database, then either export or pull from to Excel.
Whilst it may be possible, your reliant on various different technologies and interdependancies with that method.