Hi everyone,

I have this Excel workbook "book1" that used dynamic references to another workbook "book2". In order for the references to work "book2" has to be opened. Correct me if I am wrong I have searched the whole web and I couldn't find a way to do it without opening it. Why I have it set it like that. The answer is file size it dropped about 2 mb. If you guys know a better way to do this please let me know. Its a little annoying to open more than one file at the time.

So I set up an even on the workbook open to automatically open the reference every time the I open the file. It looks like this and its working fine.

My problem is when I try to close the workbook with a Workbook_BeforeClose event.

Here is the code. The workbook closes but the Windows application stays open. So I need to check if the Reference is open and if its and there is no other workbook open the close the application.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = False
On Error Resume Next
Workbooks("Reference Workbook.xlsx").Close
Application.DisplayAlerts = True
Application.Quit
End Sub
Thanks a lot