userform: object required

  • Thread starter Thread starter John Smith
  • Start date Start date
J

John Smith

I got an error saying "object required" when the script attempted
to display a userform. What is VBA looking for?

The error only occurs when I programmatically insert the code via
VBA. If I copy and paste the code to worksheet's selectionchange
event procedure, it runs fine.

Private sub worksheet_selectionchange(.....)
aboutme.show 'aboutme is a userform
end sub
 
What code are you using to create the VBA code that shows the form? It is
possible that you'll need to force a compile.

With Application.VBE.CommandBars.FindControl(ID:=578)
If .Enabled = True Then
.Execute
End If
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top