Using VBA to Call WinSQL - Can it be Done?

anttor

New Member
Joined
Apr 30, 2012
Messages
1
Hello all, I'm a bit of a novice when it comes to VBA; I can write some basic code well enough, but I have been unable to find the information I need for the following situation using Microsoft Excel 2007. In a previous job, I know our actuaries had some VBA code that had some SAS references that allowed them to run a query in SAS in the background; they had the queries to run in a Excel named ranges, then had a macro to refer to each named range and run one query after another. The VBA had the SAS Workspace Manager reference. Is there some way to use a similar technique with WinSQL? My end goal is to connect to an ODBC, run some queries, and then have the results pasted into the Excel file which will in turn feed some graphs and charts. I know that there is the option to use Microsoft Query within Excel, but it doesn't appear to meet all of my querying needs in terms of functions. Any insight would be greatly appreciated. Thank you!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,214,591
Messages
6,120,427
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top