Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro to Batch Execute Queries -Erases SQL after being executed

Status
Not open for further replies.

eerich

IS-IT--Management
Nov 2, 2003
124
US
Hello

I have 10 or so queries that I wanted to batch execute and output to Excel. In trying to automate this process, I created a macro and used the 'output to' function and selected each query to be executed with output sent to a folder. I needed to make some tweaks to the SQL and was shocked to find that once the macro ran, it wiped out the SQL code. Any help as to what would could be done to avoid this? I'm not proficient in VB to create any modules, so I'm hoping that the just the macro tool would be useful.

Thanks.
 
Is the SQL code stored in the queries or in the macro? If in the queries, do you have any steps in the macro that are deleting queries? There must be some step that is causing the deletion, because it should not just "happen".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top