Using Scheduled tasks to run VBA in excel to access SQL database
Posted on 2010-09-03
I have some VBA in an excel file that completes a SQL query into a data warehouse and uses that data to create a report and email that report out.
I would like to set-up a windows scheduled task to open the excel workbook and run the code during non-office hours.
The only problem is that the SQL query requires a non-network user name and password and I can't figure out how to instruct the scheduled task to use two sets up passwords one to login into the system and another to entering in the prompt fields to complete the SQL query using MS Query.
Any ideas would be greatly appreciated.