djmelanson
New Member
- Joined
- Jun 3, 2015
- Messages
- 17
Hi guys, sorry to repost but my last title was a bit off target. I have two workbooks named Book1 and Hydro Line Stops. I created a macro that opens the Hydro Line Stops file automatically upon opening Book1. I have copied what I have so far below:
Private Sub Workbook_Open()
Workbooks.Open Filename:="\\bdl0fs05\Departments\Hydro Mechanical\Production Management\OE Open Order Status\Hydro Line Stops.lnk"
ThisWorkbook.Activate
End Sub
This works perfectly fine but I would like to also close the Hydro Line Stops file automatically when I close the Book1 workbook. I have tried:
Workbook("Hydro Line Stops.xls").close False
but I must be doing something wrong here because it comes up with a "Run-time error '9. Subscript out of range" error. Any help would be appreciated. Thanks.
Private Sub Workbook_Open()
Workbooks.Open Filename:="\\bdl0fs05\Departments\Hydro Mechanical\Production Management\OE Open Order Status\Hydro Line Stops.lnk"
ThisWorkbook.Activate
End Sub
This works perfectly fine but I would like to also close the Hydro Line Stops file automatically when I close the Book1 workbook. I have tried:
Workbook("Hydro Line Stops.xls").close False
but I must be doing something wrong here because it comes up with a "Run-time error '9. Subscript out of range" error. Any help would be appreciated. Thanks.