I have an Excel file named "ABCD.xlsm" in three different folders.
When I open these files using VBScript one after the other I cannot run the macros and the addin.
Set fso = CreateObject("Scripting.FileSystemObject")
Set theFile = fso.OpenTextFile("D:\Temp\Excellocation.txt", 1, False)
Do While theFile.AtEndOfStream <> True
retstring = retstring & theFile.ReadLine
Loop
theFile.Close
lx_loc = retstring
fso.DeleteFile "D:\Temp\Excellocation.txt"
set objExcel = Createobject("Excel.Application")
objExcel.visible = True
objExcel.workbooks.open(lx_loc)
msgBox "RUN macro CallVSTOMethod and press ok",1, true
In the code the text file has the location of the Excel file.
If there is only one use of this code, then I have no issues. When I call this function more than once, I can't run the addin or the macro.