Hello,

I have a number of Excel files that use DB2 queries to pull information. One of these files is run daily and uses a macro to refresh the queries. I want to alter the file so that my computer automatically opens Excel, opens the file, and runs the 'Update' macro. The problem is that the DB2 requires a username and password to access our AS400. Below is the VBA code to refresh the query:

Please Login or Register  to view this content.
Is there a way to either, a) enter VBA code in Excel that will enter the username and password and select OK; or b) disable the requirement for a username and password to refresh the queries.

Any help is appreciated,
Brad