Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 64
Default automatically close second workbook

how can i get workbook 'A' to open workbook 'B' and close workbook 'B' when i
close workbook 'A'
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default automatically close second workbook

Try to copy both Event Macros into the ThisWorkbook level of Workbook A:
Private Sub Workbook_Open()
Workbooks.Open ("B.XLS")
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Workbooks("B.XLS").Close SaveChanges:=False
ActiveWorkbook.Close SaveChanges:=True
End Sub
========
Micky


uk" wrote:

how can i get workbook 'A' to open workbook 'B' and close workbook 'B' when i
close workbook 'A'

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 64
Default automatically close second workbook

workbook 'B' opens once workbook 'A' opened but workbook 'B' does not close
when workbook closed

"מיכאל (מיקי) אבידן" wrote:

Try to copy both Event Macros into the ThisWorkbook level of Workbook A:
Private Sub Workbook_Open()
Workbooks.Open ("B.XLS")
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Workbooks("B.XLS").Close SaveChanges:=False
ActiveWorkbook.Close SaveChanges:=True
End Sub
========
Micky


uk" wrote:

how can i get workbook 'A' to open workbook 'B' and close workbook 'B' when i
close workbook 'A'

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
Close form automatically upon opening workbook Ixtreme Excel Discussion (Misc queries) 2 September 18th 09 02:56 PM
automatically close form before closing Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 0 September 19th 08 08:26 PM
Automatically Close Book1 Dave486 Excel Discussion (Misc queries) 0 April 26th 08 11:47 PM
Copy from another file and close automatically Jim G Excel Discussion (Misc queries) 2 October 17th 07 01:31 AM
Close automatically a userform FARAZ QURESHI Excel Discussion (Misc queries) 4 January 7th 07 07:46 PM


All times are GMT +1. The time now is 11:09 PM.

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

About Us

"It's about Microsoft Excel"