Public Variables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have declared two Public variables to track various data. Eveything works
well until the systme crashes (in this case, which I will fix, because the
suggesated sheetname has more than 31 characters). Once it crashes the Public
variables loose their values and can't be reset; closing the workbook doesn't
help but restarting Excel does. Is this a scope problem; can I fix it in code?

Regards
 
Generally, you code should be designed not to crash, so this shouldn't be an
issue in a working app.

Running the code that originally set the values for the variables should
work again after the crash (if you hit the reset button in the VBE).
 
Thanks Tom

I agree competely, but it did; my fault in this case in that I didn't
realize that sheet names had these restrictions; generally I have error
trapping and this isn't a problem.

However, the reset doesn't solve the dilemma in this case. The Public
variables just refuse to take new values; the don't re-initilailize. I trace
the values and they exist all the way through and then dissappear at the end
of the function. I can't get them to stick until I restart Excel.

It's a bit frustrating during a debugging phase.

Regards

Les
 

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

Back
Top