Hello all,
I am trying to automate a process that we do over and over and run it at 2AM when all of the users are out of the system.
I have written a Accpac VBscript to do it. It runs fine when I run it, but it asks for my password.
I would like to run this script automatically at 2AM. I know how to schedule with VBA etc, but I can't find away around the password issue. Idealy, I would like the application code to be embedded into excel, but I can't seem to get that to work.
I have searched and have tried a lot of different things.
1) thread631-1414817 (I tried to embed this into Excel and it comes up with a dialog box asking for password), but I can't open the database. It says the session is not initialized.
2) I tried to use
Set Session = AccpacCOMAPI.AccpacSession
Session.Init "", "AS", "AS1000", "54A"
Session.Open "ADMIN", "ADMIN", "SAMINC", Date, 0, ""
But it gives me errors saying to check my user name and password. I have checked it several hundred times and I have has 0 luck.
Can someone give me code that enables me to open accpac with the password embedded into the code.
Like I said using the Accpac VBA application the app runs fine, it just needs to have a password manually added and I would like to run all of the code in Excel VBA.
It should be noted that I do not have the SDK. I am using the ACCPAC COM API that I reference to in VBA.
I am trying to automate a process that we do over and over and run it at 2AM when all of the users are out of the system.
I have written a Accpac VBscript to do it. It runs fine when I run it, but it asks for my password.
I would like to run this script automatically at 2AM. I know how to schedule with VBA etc, but I can't find away around the password issue. Idealy, I would like the application code to be embedded into excel, but I can't seem to get that to work.
I have searched and have tried a lot of different things.
1) thread631-1414817 (I tried to embed this into Excel and it comes up with a dialog box asking for password), but I can't open the database. It says the session is not initialized.
2) I tried to use
Set Session = AccpacCOMAPI.AccpacSession
Session.Init "", "AS", "AS1000", "54A"
Session.Open "ADMIN", "ADMIN", "SAMINC", Date, 0, ""
But it gives me errors saying to check my user name and password. I have checked it several hundred times and I have has 0 luck.
Can someone give me code that enables me to open accpac with the password embedded into the code.
Like I said using the Accpac VBA application the app runs fine, it just needs to have a password manually added and I would like to run all of the code in Excel VBA.
It should be noted that I do not have the SDK. I am using the ACCPAC COM API that I reference to in VBA.