Hi, our system generates reports as CSV files. I have a macro in a spreadsheet to open these, copy them and paste them into this sheet, (it then goes on and does other stuff.)
The macro just stops after opening the first CSV file, but if i step through, it works fine.
It even works right to the end if I step through to the copy line then run the macro.
Workbooks.Open Filename:= _ "C:\Reports\ Report1_Oct-2017.CSV"
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
Windows("Reports.xlsm").Activate
Sheets("CSV Report 1").Select
ActiveSheet.Paste
Range("A4").Select
Workbooks.Open Filename:= _
"C:\Reports\ Report2_Oct-2017.CSV"
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Application.CutCopyMode = False
Selection.Copy
Windows("Reports.xlsm").Activate
Sheets("CSV 2").Select
ActiveSheet.Paste
Range("A4").Select
The macro just stops after opening the first CSV file, but if i step through, it works fine.
It even works right to the end if I step through to the copy line then run the macro.
Workbooks.Open Filename:= _ "C:\Reports\ Report1_Oct-2017.CSV"
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
Windows("Reports.xlsm").Activate
Sheets("CSV Report 1").Select
ActiveSheet.Paste
Range("A4").Select
Workbooks.Open Filename:= _
"C:\Reports\ Report2_Oct-2017.CSV"
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Application.CutCopyMode = False
Selection.Copy
Windows("Reports.xlsm").Activate
Sheets("CSV 2").Select
ActiveSheet.Paste
Range("A4").Select