automatically close second workbook

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
 
S

swain.s

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top