Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 718
Default 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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop time seems dependent on unrelated workbook - Why? Richard Excel Worksheet Functions 2 March 30th 06 11:59 PM
how do i hide columns in excel so no one can open them. brianb Excel Discussion (Misc queries) 2 February 5th 06 10:09 PM
Protect Workbook vs Worksheet?? Dan B Excel Worksheet Functions 3 November 7th 05 09:02 PM
How do I hide rows in excell 2003, and see the + sign to open? S.L.Johnson Excel Worksheet Functions 2 June 21st 05 08:30 PM
Stubborn toolbars in Excel 007 Excel Discussion (Misc queries) 9 December 11th 04 02:02 PM


All times are GMT +1. The time now is 07:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"