Loss of Public Variable values with VBE open

argenta

Board Regular
Joined
Jan 10, 2004
Messages
60
I've noticed that when I run an application with the VBE open the values in Public Variables tend to get lost.

This can be very disconcerting until you realise the cause.

Can anyone explain to me why this happens?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

BrianB

Well-known Member
Joined
Feb 17, 2003
Messages
8,127
Can you explain in more detail - I have never come across this problem. Always need the VBE open during development.

What Excel version ?
 

BBHRVS

Board Regular
Joined
Nov 3, 2005
Messages
94
Hi;
To my knowledge this could happen if a macro, for one reason or another, is stopped.
e.g. if you stop voluntarily the macro or if there is a bug that stops the macro in debugging mode.
 

argenta

Board Regular
Joined
Jan 10, 2004
Messages
60
I'm running Excel 2002 SP3.

The problem doesn't only arise when a macro stops for some reason.

I have a scheduling application which holds a number of data elements in arrays. As the schedule is manipulated the arrays get updated.

If I do this with the VBE open, after one action the at least one of the arrays holding the data is empty and so the schedule is lost. Doing the same thing with the VBE closed it wroks perfectly.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,805
Messages
5,833,773
Members
430,232
Latest member
Testsubject

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top