Hi I wrote a simple function to open 3 workbooks upon opening a workbook,
Then i wrote a simple one to close the 3 workbooks, this works fine as a sub,
However when placed as a Private Sub in the BeforeClose section it doesn't work and tells me subscript is out of range
any ideas?
Then i wrote a simple one to close the 3 workbooks, this works fine as a sub,
However when placed as a Private Sub in the BeforeClose section it doesn't work and tells me subscript is out of range
any ideas?
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Windows("Expenditures.xlsx").Activate
ActiveWindow.Close
Windows("Coast Prices.xlsx").Activate
ActiveWindow.Close
Windows("Field Service Report.xls").Activate
ActiveWindow.Close
Range("A1").Select
End Sub