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?
 

Some videos you may like

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

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.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,535
Messages
5,572,759
Members
412,482
Latest member
arooshrana2
Top