ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   auto close workbook (https://www.excelbanter.com/excel-discussion-misc-queries/250255-auto-close-workbook.html)

[email protected] uk

auto close workbook
 
what code would i have to put in VBA (data) to close the data workbook when i
close the (test) workbook or visa versa

מיכאל (מיקי) אבידן

auto close workbook
 
Check the Event-Macro: Workbook_BeforeClose
Micky


uk" wrote:

what code would i have to put in VBA (data) to close the data workbook when i
close the (test) workbook or visa versa


מיכאל (מיקי) אבידן

auto close workbook
 
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


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

Check the Event-Macro: Workbook_BeforeClose
Micky


uk" wrote:

what code would i have to put in VBA (data) to close the data workbook when i
close the (test) workbook or visa versa



All times are GMT +1. The time now is 04:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com