View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default userform: object required

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




"John Smith" wrote in message
...
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