Macro Won't Open up Userform

  • Thread starter Thread starter PokerZan
  • Start date Start date
P

PokerZan

Hello,

I have created a UserForm for inputing data and I am trying to use
simple macro to open from a button on the sheet. I have done thi
before so I'm not sure why it isn't working. I am creating a module i
the spreadsheet with the following:

Sub OpenInputForm()
frmTrendScoreCard.Show
End Sub

When I click on it it says it is missing an object... Then runs th
DeBugger and highlights the "frmTrendScoreCard.Show" section.

While I have done this before, I'm by no means what I would conside
adept. If I need to add more inforfmaiton

TYIA,

PZa
 
Are you 100% sure that your form is called 'frmTrendScoreCard'?

Not 'fmTrendScoreCard' or some other minor variation?

Simple but most likely!
 
Right-click the error line "frmTrendScoreCard.Show" and select Definition.
If VBA does not take you anywhere then the form name is probably spelled
wrong (happens all the time!!!)
 
I have double checked the name (even copied and pasted the name) and i
is still giving me the error #424 Object Required. I'm baffled..
:confused
 
I have double checked the name (even copied and pasted the name) and it
is still giving me the error #424 Object Required. I'm baffled...
:confused:
 
When I click on the definition as JNW suggested it pulls up the cod
behind my form... if that helps with anything
 
Microsoft's website says the following: "This behavior can occur if the
references to the button are no longer valid because the menu context has
been switched to another document. "

I would make sure to also check the reference to the form. Do you have more
than one workbook open? Has the file name changed and affected the
reference? I really don't know what else to suggest other than double
checking the entries. In design mode, double-click the button to make sure
that it is referencing the right code.

Also, I couldn't tell from before, but make sure that the following code is
in a separate module and not the code for the sheet (you may have already
done this)
Sub OpenInputForm()
frmTrendScoreCard.Show
End Sub

I hope that helps. I've tried to recreate what you're saying and haven't
been able to at all. Never seen this before...
 

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