VB Code Remains In Memory

P

Paul Moles

I have a workbook with several Macros, if the workbook is closed but Excel
left open, (using close window "x" or File Close)The Macro code remains in
the visual basic editor and can even become duplicated/triplicated if the
workbook is susequently reopened in the same Excel session.

The workbook includes Auto_Open and Workbook_BeforeClose macros but neither
have contents that would suggest or require this activity.

Is this normal behaviour? if so what is its purpose and is it possible to
change it so the Visual Basic code closes when the Workbook is closed.

Thanks
 
L

Lonnie M.

Paul,
At the end of Workbook_BeforeClose, you might try placing the following
code:
Application.Quit

HTH, it probably isn't actually fixing what is wrong, but it should
give you a work around-Lonnie
 
R

Ron de Bruin

Hi Paul

Maybe you have use "set" in your code and don't set it to nothing when you close your file.

If you dim outside a macro (at the top of a module) you must set it to nothing when you close the file.
If you dim in the macro you don't have to do this.

Set ???? = Nothing
 
P

Paul Moles

Apologies multiple posting, "lying" server reported problem that message
could not be uploaded to excel.worksheet.functions so tried this group
instead.

No "SET" in the project code.

Any further suggestion?

Thanks

Paul
 
P

Paul Moles

I have on this machine will have to check user machines, where google toolbar
will not be present, to see if VB behaves differently.

Thanks

Paul
 
P

Paul Moles

Seems to be an Office 2003 phenomenon as removing Google toolbar on this
machine doesn't change VB behaviour,(don't have a virgin 2003 machine to
check for orphaned files) but on Office Xp machines even with Google toolbar,
VB is as expected and closes with Workbook. All machines Win Xp.

Any other suggestions?
 
D

Dave Peterson

I've seen it xl97 and win98.

I current use xl2002 and win98 at home. I've seen it there, too.

I use xl2k and win2k at work and have seen it there.

I don't use the google desktop search anywhere.

Aside from being an irritant, I've never seen it cause trouble for me. And if
I'm really irritated, I close and reopen excel.
 
T

Tom Ogilvy

It occurs on a repetitive basis? Or is it an occasional thing? The OP
seems to describe a consistent problem.
 
D

Dave Peterson

Intermittent (even infrequent, as far as I've noticed). I've never noticed a
pattern.

But it could be much more often than I notice since I'm not in the VBE with
every workbook update.

I understand that some people have suggested that removing the Google Desktop
search utility. I just wonder if removal fixes it or if it's just a
coincidence.
 

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