Consulting

Results 1 to 3 of 3

Thread: Solved: User Form Properties Disappear

  1. #1
    VBAX Newbie
    Joined
    Sep 2011
    Posts
    4
    Location

    Unhappy Solved: User Form Properties Disappear

    For some reason, the properties of my userform keep erasing. When I try to use the UserForm1.Show command I keep getting a "Run-time error '5852': Requested Object not available" I go to debug, and it highlights "Userform1.Show"

    When I click on the userform under the Forms folder in VB editor, nothing appears in the properties window. When I click on the modules or Microsoft Word Objects, their properties appear just fine.

    If I right click and select view object, I get an error message that says cannot perform operation. When I right click a second time and say show object, then it works and all of the information shows in the properties window. I save, exit, and go back in and again get the same issue.

    I am using Word 2003. What can I do to fix this? I can't open the UserForm because of this error. I have attached a screenshot if that may be useful.

    Thank you for the help!
    Attached Images Attached Images

  2. #2
    VBAX Master
    Joined
    Feb 2011
    Posts
    1,480
    Location
    You have option explicit on at the top of your module (which is a good thing). This requires variable declaration.

    [vba]
    Sub Test
    'create the variable
    dim myForm as UserForm1

    'create a new instance of the userform
    Set myForm = New UserForm1

    'Show it
    myForm.Show

    'do whatever you want from the form here

    'empty the variable
    set myForm = Nothing
    End Sub
    [/vba]

  3. #3
    VBAX Newbie
    Joined
    Sep 2011
    Posts
    4
    Location

    It worked

    Thank you for your help Frosty, worked like a charm!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •