Phantom workbooks in VBE in Excel 2007

J

John

I have been porting a program to 2007 from 2003. The main program
workbook will open any number of new books based on a template with
it's own ribbon. This ribbon has to call code in the main book. So
there is a reference to the main book in the template.
It ends up with a lot of books called wbook1 wbook2 etc but the vba
projects all have the same name. As all based on the same template.
When the program is closed each new book is closed and an attempt made
to remove it's reference to the main book. The last book closed is
always left visible in the VBE as a phantom book, although not in the
workbooks list. Sometimes the Main book will not close as there is
still a reference to it in the Phantom book. If I manually remove the
reference from the phantom book in VBE I can close the Main book.
Can anyone help with the reason why I am getting phantom books or a
reliable way to really remove a reference to another workbook.
John Robinson
 
H

Héctor Miguel

hi, John !

could you offer the code you use in your attempts to close the (references to) main workbook ?
and the code used (if any) in your main workbook '_beforeclose' event ?

regards,
hector.

__ OP __
 

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

Top