1

So, I'm trying to manipulate things such as button names and visibility depending on actions a user does in a userform.

For example, they wish to make a button that was previously invisible visible and also change it's name. So I set the buttons' visibility to true (it is set to false on the userform button properties) and then make the changes, but as soon as I close the userform and reopen it, all the changes made have been undone. All buttons are still invisible and have their original names.

I'm guessing this is because as soon as I close and reopen it, everything just reverts to what their original properties were on creation.

Is there any way to change a button property permanently? Most importantly: Visibility and button Captions.

Community
  • 1
  • 1
Fernie
  • 11
  • 2
  • Possible duplicate of [Saving the form state then opening it back up in the same state](https://stackoverflow.com/questions/14616958/saving-the-form-state-then-opening-it-back-up-in-the-same-state) – bgfvdu3w Aug 19 '17 at 18:32
  • UserForm controls always will start with their initialized or designed properties. If you want to restore changed property values you'll have to save their property values somewhere and restore them via UserForm_Initialize. A proper saving method would be to use CustomDocumentProperties (see http://stackoverflow.com/questions/14863250/how-to-add-a-documentproperty-to-customdocumentproperties-in-excel) instead of writing some values to a worksheet or a file. – T.M. Aug 19 '17 at 19:20

0 Answers0