Automatically closing slave workbook when main workbook is closed...

P

Potsy

Hi

Have two workbooks - lets call them workbook1 and workbook2 for ease.

Workbook 1 is the main document, however, some of data is drawn from
Workbook 2 which is currently mininmized by following code in VBA
Workbook1:

Private Sub Workbook_Open()
Workbooks.Open "Workbook2.xls"
ActiveWindow.WindowState = xlMinimized
End Sub

Ideally I would like Workbook2 opened and hidden so that user does not
even know it is running and then shut down automatically when
Worokbook1 is closed.

PS - when Workbook1 is saved it will be renamed, however Workbook2
title will stay static.

thanks in advance.
 
Top