Thanks for everyones input. (The code is being modified by itself.) I will need to approach this a different way. I know I am going aroung the world to do a simple task but I can't see the forest for the trees, I guess.
My goal: Auto log into a Add-in in an Excel file.
Here is where I stand:
I created a batch file to open excel. (If I open excel with a vbs file it does not load the Add-Ins.)
START "" "C:\TEST\PRICE ONLY TEMPLATE.xlsb"
PING 127.0.0.1 -n 3
START "" "C:\Documents and Settings\metrazal\Desktop\PRICE ONLY.VBS"
I created a script file to run a macro created in the excel file:
Set xl = GetObject(, "Excel.Application")
xl.Application.Workbooks.open "C:\TEST\Price Only Template.xlsb"
xl.Application.Visible = True
xl.Application.run "'C:\TEST\Price Only Template.xlsb'!PriceOnly"
Set xl = Nothing
Then I run the macro: (It runs the add-in)
Sub PriceOnly()
Dim Wshell
Set Wshell = CreateObject("WScript.Shell")
Wshell.SendKeys "%x"
Application.Wait Now() + TimeValue("00:00:01")
Wshell.SendKeys "l"
Application.Wait Now() + TimeValue("00:00:01")
Wshell.SendKeys "{DOWN}"
Application.Wait Now() + TimeValue("00:00:01")
Wshell.SendKeys "{ENTER}"
Application.Wait Now() + TimeValue("00:00:05")
Set Wshell = Nothing
Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run "PriceOnly2.vbs"
Set objShell = Nothing
End Sub
It runs the addin to a point but the login menu will not open until my macro closes so I was going to load another script, close the macro, and then use the other script to fill in the prompt which I hope will appear after the macro within Excel has closed. I'm sure I've confused the hell out of everyone by now but humor me if you have any suggestions.
Thanks,
Met
Bookmarks