Hi,
I have a java code that populates data on my XLSM file, the problem is, the java code can't handle the execution of Macro, so what I'm just doing is to populate the excel file with java and then open the excel and save it manually and then the macro will be invoked.
I wanted to do it automatically, so I created a VB script that will open the file and will save it as well but the problem is, even though it saves and closes the file, it seems that it didn't invoked the Macro.
@edit:
The macro is executed the moment I hit save (Ctrl + S) or when I click the close button and save.
Any ideas on how can I do this? I'm just new with Visual Basic.
Thanks.
I have a java code that populates data on my XLSM file, the problem is, the java code can't handle the execution of Macro, so what I'm just doing is to populate the excel file with java and then open the excel and save it manually and then the macro will be invoked.
I wanted to do it automatically, so I created a VB script that will open the file and will save it as well but the problem is, even though it saves and closes the file, it seems that it didn't invoked the Macro.
@edit:
The macro is executed the moment I hit save (Ctrl + S) or when I click the close button and save.
Any ideas on how can I do this? I'm just new with Visual Basic.
Code:
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Open("C:\Users\USER\Desktop\Sample.xlsm")
objWorkbook.Save
objExcel.Quit
Comment