I have a desktop shortcut to a vbs script (below) that opens Excel (invisible) and displays a form. I use Windows API to add an icon to the titlebar of the form, to add a minimize button to the form, and add the programs name to the Taskbar. This works perfectly.
If I double click on the desktop shortcut to add a second instance of my Excel program, these API features do not work correctly - the icon does not appear, the form minimizes to the bottom LHS of the screen instead of to the Taskbar, and the name is not added to the Taskbar. (I use other API commands within the program and they seem to work perfectly).
Instead of using the desktop shortcut, if I double click on the vbs script, the second instance behaves perfectly.
Any suggestions as to what is happening here?
thanks
This script is located in the same folder as the Excel file "Test1.xlsm":
Dim xlApp
Dim PathFileName
PathFileName = left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))-(len(WScript.ScriptName))) & "Test1.xlsm"
Set xlApp = CreateObject("Excel.Application")
xlApp.Workbooks.Open PathFileName
Set xlApp = Nothing
If I double click on the desktop shortcut to add a second instance of my Excel program, these API features do not work correctly - the icon does not appear, the form minimizes to the bottom LHS of the screen instead of to the Taskbar, and the name is not added to the Taskbar. (I use other API commands within the program and they seem to work perfectly).
Instead of using the desktop shortcut, if I double click on the vbs script, the second instance behaves perfectly.
Any suggestions as to what is happening here?
thanks
This script is located in the same folder as the Excel file "Test1.xlsm":
Dim xlApp
Dim PathFileName
PathFileName = left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))-(len(WScript.ScriptName))) & "Test1.xlsm"
Set xlApp = CreateObject("Excel.Application")
xlApp.Workbooks.Open PathFileName
Set xlApp = Nothing