When I open the file Book1.xlsm with a vbs script, it doesn't see that Book2.xlsm is already open, and this is a problem because the macro1 I want to run in Book1 does something different depending on if it is open or not. Is there a line of code to run in the shell or in vba to have excel fix this mistake?
Here is the code in the vbs file:
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.DisplayAlerts=False
Set wb = objExcel.Workbooks.Open("C:/Test/Book1.xlsm")
objExcel.Application.Run "Book1.xlsm!Macro1"