Is it possible to open a excel template, transfer the data into it, and then run a macro already created on the template?
Code so far:
Dim strPath As String
Dim xlApp As Object
Dim xlSheet As Object
strPath = "C:\test.xls" ------- I can imagine its a change here -------
Set xlApp = CreateObject("Excel.Application")
Set xlSheet = xlApp.workbooks.Open(strPath).Sheets(1)
Set xlSheet = xlApp.workbooks.Open("C:\stormpactemp.xls").Sheets(1)
With xlApp
.Run "stormpactemp.xls!MyMacro"
End With
Code so far:
Dim strPath As String
Dim xlApp As Object
Dim xlSheet As Object
strPath = "C:\test.xls" ------- I can imagine its a change here -------
Set xlApp = CreateObject("Excel.Application")
Set xlSheet = xlApp.workbooks.Open(strPath).Sheets(1)
Set xlSheet = xlApp.workbooks.Open("C:\stormpactemp.xls").Sheets(1)
With xlApp
.Run "stormpactemp.xls!MyMacro"
End With