Open and Hide a workbook
How can I open Workbook 1 and have Workbook 2 automatically open and be
hidden? Then, when Workbook 1 is closed, will Workbook 2 close also? Thank you in advance. |
Open and Hide a workbook
Paste following code into ThisWorkbook's code:
Private Sub Workbook_Open() Dim oWB As Workbook Set oWB = Workbooks.Open(Me.Path & "\Workbook2.xls") oWB.Windows(1).Visible = False End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Workbooks("Workbook2.xls").Close False End Sub HTH -- AP "MBum" a écrit dans le message de news: ... How can I open Workbook 1 and have Workbook 2 automatically open and be hidden? Then, when Workbook 1 is closed, will Workbook 2 close also? Thank you in advance. |
All times are GMT +1. The time now is 09:17 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com