Hello,
i have following Problem:
I wrote a Macro in Word, that opens an Excel file, changes stuff and saves ist again. When it runs a second time i get "method rows of object _global failed" as Error. (It works fine, if i close Word inbetween the runs).
I suppose it's because the EXCEL:EXE *32 process does not terminate. (i can see it in the Task-Manager)
I appreciate any help.
i have following Problem:
I wrote a Macro in Word, that opens an Excel file, changes stuff and saves ist again. When it runs a second time i get "method rows of object _global failed" as Error. (It works fine, if i close Word inbetween the runs).
I suppose it's because the EXCEL:EXE *32 process does not terminate. (i can see it in the Task-Manager)
I appreciate any help.
Code:
Dim oExcel As Excel.Application
Dim oWB As Workbook
Set oExcel = New Excel.Application
oExcel.Visible = False
Set oWB = oExcel.Workbooks.Open(spath)
NextRow = oWB.Worksheets(1).Range("A" & Rows.Count).End(xlUp).Row + 1 ' Error at this row
'more code
oWB.Save
oWB.Close
oExcel.Quit
Last edited by a moderator: