I have 25 files that I have to open at once. They are all passworded with different passwords. I have created a batch file that will open them all. It works, but I have to enter the password for each one over and over. I know there has to be a way to modify my batch file to enter the passwords. I read that it may be possible to use vbs to do this.
My batch file looks like this now (it is located in the folder with the files):
Start /max "S:\Budget\2012\Set up Files\" "Bgt 2012 File1.xls"
Start /max "S:\Budget\2012\Set up Files\" "Bgt 2012 File2.xls"
Start /max "S:\Budget\2012\Set up Files\" "Bgt 2012 File3.xls"
Exit
This is what I found on the net but is not working for some reason even though I saved it as a vbs:
sub open_passworded_file ()
set wshshell = wscript.CreateObject("wscript.shell")
Workbooks.open "S:\Budget\2012\" "Bgt 2012 File1.xls" 'this is where your file goes
WshShell.SendKeys "password{enter}" 'this is where your password goes
End Sub
Even if I have to make a dummy excel file and run a macro from that file that opens all the other files and enters the respective password that would be beneficial.
Any suggestions appreciated.
Thanks,
rsulliva
My batch file looks like this now (it is located in the folder with the files):
Start /max "S:\Budget\2012\Set up Files\" "Bgt 2012 File1.xls"
Start /max "S:\Budget\2012\Set up Files\" "Bgt 2012 File2.xls"
Start /max "S:\Budget\2012\Set up Files\" "Bgt 2012 File3.xls"
Exit
This is what I found on the net but is not working for some reason even though I saved it as a vbs:
sub open_passworded_file ()
set wshshell = wscript.CreateObject("wscript.shell")
Workbooks.open "S:\Budget\2012\" "Bgt 2012 File1.xls" 'this is where your file goes
WshShell.SendKeys "password{enter}" 'this is where your password goes
End Sub
Even if I have to make a dummy excel file and run a macro from that file that opens all the other files and enters the respective password that would be beneficial.
Any suggestions appreciated.
Thanks,
rsulliva