Dear all,
I would like to totally automate report which I create every month. So far, I create 2 modules. First module I use to get data from SAP and second module I use to create pivot table and send data to already prepared table. Due to error (out of range) in first module, I have to stop macro and copy paste data manually in file where I run macro. Problem is that VBA does not recognize workbook which I export from SAP. I also read that there could be some issue with Excel instance. I also try with workbook as object but it doesn’t work. I would be very happy if somebody helps me to solve this issue and of course to help others if they have the similar issue. Code is down below and I also mark where issue appear. Kind regards Dean
Workbooks("Delovni list v Basis (1)").Sheets("List1").Activate -> where issue appear
ActiveSheet.Cells.Select
Selection.Copy
Workbooks("SVTK LJ tekoce 2021 tabela.xls").Sheets("List1").Activate
ActiveSheet.Range("A1").Select
ActiveSheet.Paste
Workbooks("Delovni list v Basis (1)").Close SaveChanges:=False
Bookmarks