|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
5941 requested member of collection does not exist Prevents Userform from Showing
I have two userforms in one project. One is called frm1a and the other is called frm1b. I am trying to insert controls into the word document that when double clicked, cause the appropriate userform to show. When I use the code below with two separate macro buttons, the first works perfectly. When I attempt to have the second userform (frm1b) to show, I get the error listed above. Both of the callfrm procedures are in the same module, I have tried to make it work by putting them in separate modules.
When I debug and hover over frm1b, it says "object variable or With block variable not set." Any ideas? I think it's really simple, staring me in the face and I just can't see it.... Code:
Option Explicit Sub Callfrm1a() Dim oFrm As frm1a Set oFrm = New frm1a oFrm.Show Unload oFrm Set oFrm = Nothing lbl_Exit: Exit Sub End Sub Sub Callfrm1b() Dim oFrm As frm1b Set oFrm = New frm1b oFrm.Show Unload oFrm Set oFrm = Nothing lbl_Exit: Exit Sub End Sub |
#2
|
|||
|
|||
Solved my own problem:)
Discovered a faulty line of code in the Userform that was pushing the error code.
|
Tags |
5941, macro problem, userform |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
strange grayed out line prevents copying or deletion after endnotes | JerryL | Word | 1 | 02-09-2014 08:59 AM |
Using excel to track video game collection - questions | Slurpyga | Excel | 3 | 07-05-2012 05:48 PM |
showing a userform after hiding | jillapass | Word VBA | 0 | 05-31-2012 06:13 AM |
Outlook 2010 problem (new member) | Cullers | Outlook | 0 | 01-21-2011 10:18 AM |
New Member with a problem | davieG | Outlook | 0 | 06-03-2006 02:45 PM |