Intermedius
New Member
- Joined
- Oct 12, 2012
- Messages
- 32
Hello,
I have a subroutine that requires the opening of a workbook.xlsx, copy the data from the 1st sheet and paste it into the document that is running the code.
The run time error is hanging up at the .Activate line. I've run this code on 100's of files, multiple times a month to actualize varying projects and never had this issue until today.
I've google this runtime error and all issues seem to revolve around .activate all the way back to 2008.
How is this affecting My code now? I've been running these lines for 18 months in several documents all accessing the same file at this address C:\SAP\SAP GUI\Forecast.XLSX
I have a subroutine that requires the opening of a workbook.xlsx, copy the data from the 1st sheet and paste it into the document that is running the code.
The run time error is hanging up at the .Activate line. I've run this code on 100's of files, multiple times a month to actualize varying projects and never had this issue until today.
I've google this runtime error and all issues seem to revolve around .activate all the way back to 2008.
How is this affecting My code now? I've been running these lines for 18 months in several documents all accessing the same file at this address C:\SAP\SAP GUI\Forecast.XLSX
VBA Code:
Sub CopyPasteLatestDataFile()
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
Application.ScreenUpdating = True
'Open and Activate Forecast Workbook and Data Sheet.
Workbooks.Open filename:="C:\SAP\SAP GUI\Forecast.XLSX"
Workbooks("Forecast").Worksheets("Sheet1").Activate
ActiveSheet.Range("A1").Select