Userform Run-time Error

Microsoft Excel 2003 (full product)
July 1, 2010 at 06:00:28
Specs: Windows XP Professional SP3, 512 MB
I have created a "Certificate" template at work.
When a project is done, we issue a certificate to the customer.

The template works as follow:

The workbook starts with two visible sheets.
"Create_A_New_Certificate" and "Data"

There is a lot of hidden sheets as well.
One sheet for each type of certificate.

The "Create_A_New_Certificate" sheet contains some instructions and an
The user click the autoshape, and the Userform ("Cert_UE") loads.

After the user entered all the necessary information, "Cert_UE" will place
that information on the "Data" sheet.

The sheet that matches the certificate type will be made visible and
selected. This is the Certificate that we issue.
(Only the Certificate and "Data" will remain visible.)

The Certificate will be printed, saved, and closed.

So far, no problems.

The Certificate may need to be modified (and re-issued).
There is an autoshape on each Certificate.
Clicking it, should load the Userform "Cert_Mod".
"Cert_Mod" should allow the user to edit the existing information.
(Clicking the "Cert_Mod_ChangeButton" will replace the existing information
with whatever the user entered.)

The code for "Cert_Mod": (Exactly the same as for "Cert_UE", except for
the name.)
(This is placed in a standard module.)

Sub Certificate_Modify()

' Show the Userform.
    Load Cert_Mod

End Sub

The "Initialize" event for "Cert_Mod":
(This is placed in the Userform.)

Private Sub UserForm_Initialize()

' Show the Labels.
    Cert_Mod_ErfLabel.Visible = True
    Cert_Mod_AreaLabel.Visible = True
' ' ' ' ' ERROR HAPPENS HERE ' ' ' ' '
    Cert_Mod_OwnerLabel.Visible = True
    ' Some more lines...
    Cert_Mod_YearLabel.Visible = True

' Pre-Fill the Input Boxes.
    Cert_Mod_Erf_Input.Text = Range("ProjectErf_Number").Value
    ' Some more lines...
    Cert_Mod_Year_Input.Text = Range("Certificate_FileYear").Value

' Show the Input Boxes.
    Cert_Mod_Erf_Input.Visible = True
    ' Some more lines...
    Cert_Mod_Year_Input.Visible = True

' Show the Button.
    Cert_Mod_ChangeButton.Visible = True

End Sub

When I step through the code (with F8), I get an error between the
"Cert_Mod_AreaLabel.Visible = True" and "Cert_Mod_OwnerLabel.Visible =
True" line.
Run-time error '424':
Object required

Can someone please tell me where I went wrong?

(I can give a link to the Certificate template if needed.)

See More: Userform Run-time Error

July 1, 2010 at 06:09:41
First, I'd be very surprised if the error happened between 2 lines.

An error occurs when a line can't be executed for some reason, so the error is happening at a specific line, not between them.

Nothings happens between lines to cause an error.

That said, please post the link.

Report •

July 1, 2010 at 06:42:56
"...the error is happening at a specific line..."
Ok, then I would say it happens at the "Cert_Mod_OwnerLabel.Visible =
True" line.

Link to the files (zipped):
(Template, Prepared Sample, Sample Database, Numbers

If you want to test it, all the necessary setting can be
modified on the "Data" sheet.

Please test the template with "Certificate Type = J291" and
"Certificate Format = Normal".

Report •

July 1, 2010 at 07:10:23
Maybe somebody else can test this during the day but I can't open zip files on my work machine.

I can possibly take a look at it tonight.

Report •

Related Solutions

July 1, 2010 at 07:20:44
Sorry about that.
Here is a link to files (extracted):

No rush in looking at them.
I have been busy with it for quite some time, so waiting a bit is
not going to kill me.

Report •

July 5, 2010 at 09:57:02
Derbydad03, if you haven't looked at those files yet, don't bother.

It seems that the Userform display correctly (without errors) if I
don't make the labels visible via code.

So, I am just going to skip the "label visible" part.

Report •

Ask Question