auto close workbook

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

swain.s

what code would i have to put in VBA (data) to close the data workbook when i
close the (test) workbook or visa versa
 
Check the Event-Macro: Workbook_BeforeClose
Micky
 
To be more precise - use the hereunder code in the TEST WB:
====================================
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Workbooks("DATA.XLS").Close SaveChanges:=False
End Sub
==========
Micky
 

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

Back
Top