If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Run macro through Excel ODBC connection

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-01-07, 23:57
gaudian gaudian is offline
Registered User
 
Join Date: Dec 2002
Posts: 4
Run macro through Excel ODBC connection

Hi,
Is there a way to run an excel macro through an Excel ODBC Connection?
i.e. Connect to an excel workbook using ODBC and then execute a command that will run a macro.
Any help really appreciated!
Thanks,
Eduardo
Reply With Quote
  #2 (permalink)  
Old 08-03-07, 21:21
savbill savbill is offline
Registered User
 
Join Date: Feb 2004
Posts: 533
If you are accessing an Excel file by ODBC, you are only retrieving data. It is not really possible to directly activate a process in the data file you are accessing the data from. Supposing you want to do something to the data using a macro. You can retrieve your data by a database query using ODBC or preferably ADO into a dataset. Then write the data to a target Excel worksheet. Then run the a macro to take action on the data once it is written to the worksheet.

Another scenario would be to run a query on your file and based on the results take an action to run on the data file. Then close the data connection and run a process to open the file run a procedure on the file, and close it. You could do this while screen updating is false or while the focus is off the file so it does not display the workbook being opened or show the script actions. You would not activate the macro from the data connection but could simulate it this way.
__________________
~

Bill

Last edited by savbill; 08-03-07 at 21:32.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On