Home > Software engineering >  VBA how to close the workbook before keep public variables don't release?
VBA how to close the workbook before keep public variables don't release?

Time:11-17

I have a few work table events depend on a public variable, I want to always have the function of information transmission, the common variables rather than the end of an event is released, what method?

CodePudding user response:

Defined in every work book such a public variable, and then, as long as the value of this variable is synchronous update all other corresponding variables in the workbook?

For reference only

CodePudding user response:

reference response: 1/f, VB amateurs
defined in every work book such a public variable, and then, as long as the value of this variable is synchronous update all other corresponding variables in the workbook?

For reference only
I don't need to work across the book, just don't know why, I set the variable will suddenly be recycled,

CodePudding user response:

Module-level variables;

Suddenly be recycled is what mean?

CodePudding user response:

reference milaoshu1020 reply: 3/f
module-level variables;

Suddenly be recycled is what mean?
is defined by rights with the public and the static variables will retain the last run of results, it was not until close the workbook recovery, but the actual I met, small variables such as an integer, will maintain a few times in all of a sudden be recycled, big variables such as a object, write their own may be twice or once didn't keep recycling, I also don't know is what reason, also don't know with system or is there a link between the WPS,

CodePudding user response:

You are using WPS VBA?

CodePudding user response:

reference 5 floor milaoshu1020 reply:
is the WPS VBA you use?
yes, the unit is unified
  •  Tags:  
  • VBA
  • Related