View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
chuckm chuckm is offline
external usenet poster
 
Posts: 15
Default Workbook_open not running and Phantom Projects

I recently discovered that I have the problem of workbook_open not
firing upon subsequent openings of my workbook....e.g. start excel and
open workbook...workbook_open runs fine. Close workbook and re-open
it, workbook_open does not run. I also discovered that when this
happens I have the phantom project problem....e.g. VBA project does
not close when workbook is closed and a 2nd project is opened when the
workbook is re-opened.

I have searched the forum and read most of everything on these two
issues. I believe they are related and the workbook_open not
running is probably caused by the project not closing. Problem is I
still don't know what to do about it.

This happens for an app that I have been working on and enhancing for
the past few years. Happens on 2 separate computers running XP with
excel 2003 and 2000.

Now, I can create a new workbook and put a msgbox in the workbook_open
and it works all the time.

I have tested my app through all the dev versions and found the
version where this starts happening....e.g., problem does not happen
for all versions earlier than this and happens for all versions
thereafter.

The differences between the good version and bad version are
small.....just 3k diff in file size and about 40 lines of bland VB
code.

All changes were contained in 2 different modules (23 modules in
total). If I swap the modules the problem does not follow it. If I
remove these modules entirely the problem does not go away. So, I
started removing modules 1 by 1 and found a module whose presence
seems to cause the problem....e.g. once that particular module was
removed, the problem went away. But, this module is identical to
the one in previous versions!

The workbook_open just makes a sheet current, reads data from a cell
and then displays a splash screen/userform. nothing fancy or
tricky.

So, I am stumped and don;t know where to go. As others have
reported, If Excel is closed and restarted, the problem is
cleared.....But I'd like to solve it and seeing that I have 2 very
similar workbooks it seems that I should be able to find out what is
causing it.

Can anyone out there give me some guidance here? At this point I
don't know what to look for.
thanks
chuck