automatically close second workbook

  • Thread starter Thread starter swain.s
  • Start date Start date
S

swain.s

how can i get workbook 'A' to open workbook 'B' and close workbook 'B' when i
close workbook 'A'
 
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
 
workbook 'B' opens once workbook 'A' opened but workbook 'B' does not close
when workbook closed
 
Back
Top