Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Public Variables

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
--
Les Gordon
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Public Variables

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).

--
Regards,
Tom Ogilvy

"Les Gordon" wrote in message
...
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
--
Les Gordon



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Public Variables

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

"Tom Ogilvy" wrote:

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).

--
Regards,
Tom Ogilvy

"Les Gordon" wrote in message
...
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
--
Les Gordon




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
public variables johnny Excel Discussion (Misc queries) 7 February 27th 08 03:44 PM
Public variables johnny Excel Discussion (Misc queries) 2 February 24th 08 05:05 AM
Public Variables Jerry McNabb Excel Discussion (Misc queries) 0 February 24th 08 01:26 AM
Declaring Variables Public ob3ron02[_8_] Excel Programming 1 October 25th 04 02:14 PM
Public variables and Class Aidy Excel Programming 1 April 8th 04 03:25 PM


All times are GMT +1. The time now is 04:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"