none
Can't rename an UserForm (to "old" name) RRS feed

  • Question

  • In VBA Excel 2016 I can't rename UserForm to name, which had been previously assigned to another form.

    For instance, 4 simple steps:

    • in Project->Forms execute "Insert UserForms" : is created 'UserForms1'
    • once more p.1 : now is created 'UserForms2'
    • from context menu (on UserForms1 in Projects window) execute "Remove UserForm1" : form is removed
    • in Properties window try rename  'UserForms2' to 'UserForms1'  (which is currently absent)- and I CAN'T to do this !

    For why? Was the name 'UserForms1' persisted somewhere after deleting? - where? why VBA writes "Path/File access error" after attemption?

    What shall I do to set exactly this name: 'UserForms1'

    Thanks

    PS I try to do similar things programmatically from VBA, but it does not work in any cases... 


    • Edited by Leon Rom Wednesday, November 29, 2017 10:38 PM
    Wednesday, November 29, 2017 10:18 PM

All replies

  • UserForm1 still exists in the saved version of the workbook. Save the workbook. It should then be possible to rename UserForm2 to UserForm1 again.

    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Proposed as answer by Wouter Defour Thursday, November 30, 2017 12:04 PM
    Wednesday, November 29, 2017 11:07 PM
  • Thank you,- now my renaming really works after saving of the Workbook!

    But... if You please... does it means, that Excel save something (forrm's description) in background on my "4 steps"? And why the creation of User's form is saved, but deletion - is not?  And could you recommed something to read about this (and about events in VBA IDE - it's my next problem) in Internet?

    Thanks once more!

    Leon


    • Edited by Leon Rom Thursday, November 30, 2017 9:34 AM
    Thursday, November 30, 2017 9:30 AM
  • I must admit that I don't really know this works, and I'm afraid there is little to be found about this behavior, if anything.

    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Thursday, November 30, 2017 10:54 AM
  • Thanks anyway :)
    Thursday, November 30, 2017 3:03 PM