The_Kurgan
Active Member
- Joined
- Jan 10, 2006
- Messages
- 270
I'm attempting to use the BeforeClose event to open another workbook, gather data, and then place it into the original workbook. However, once the workbook is open, the code fails to manipulate it. The ribbon and tabs don't seem to be visible and when the code tries to activate the new workbook or select a tab within it, I get a "Subscript out of range" error. Any workarounds or fixes?
The code is very basic:
TIA
The code is very basic:
Code:
Workbooks.Open Filename:="X:\Accounting\Warehouse.xlsx"
Windows("Warehouse.xlsx").Activate '"Subscript out of range" error
Sheets("WH Forecast").Select
TIA