error with userform, "unable to create embedded object"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a very simple userform. It contains only a label control.

It will not work.

When I try to execute I get the error:

Run-time error '31032':
Unable to create embedded object

The code calling the form is:

Private Sub CommandButton1_Click()
UserForm3.Show
End Sub

CommandButtun1 is on sheet 1 of my workbook.

This is my first attempt at userforms. Is there something basic that I'm
missing? I 've read books and web sites and help files and have been unable
to solve this problem
 
Hello Jeff,

2 Questions. How did you create the CommandButton and Is the Sub code
for CommandButton1 part of UserForm3 or the Worksheet?

Thanks,
Leith Ross
 
Hi Leith,

thanks for your response!
2 Questions. How did you create the CommandButton and Is the Sub code
for CommandButton1 part of UserForm3 or the Worksheet?

The command button was created on sheet1 of my workbook using the control
toolbox toolbar.

The sub code was created by right clicking the command button (while in
design mode) in the worksheet and then clicking view code on the popup menu.
In the VB editor the sub code appears in a window that says sheet1. I
figure this means it is part of sheet1 and not part of UserForm3. I can
execute other code in the sub and it will work (such as MsgBox prompt:="test
message commandbutton1"). It only gives the error when it gets to the
UserForm3.Show statement.

Jeff
Jeff
 
posted this using the microsoft site... posting here manually to speed
up the process...


Hi Leith,

thanks for your response!

> 2 Questions. How did you create the CommandButton and Is the Sub
code
> for CommandButton1 part of UserForm3 or the Worksheet?

The command button was created on sheet1 of my workbook using the
control
toolbox toolbar.

The sub code was created by right clicking the command button (while
in
design mode) in the worksheet and then clicking view code on the popup
menu.
In the VB editor the sub code appears in a window that says sheet1. I
figure this means it is part of sheet1 and not part of UserForm3. I
can
execute other code in the sub and it will work (such as MsgBox
prompt:="test
message commandbutton1"). It only gives the error when it gets to
the
UserForm3.Show statement.

Jeff
Jeff
 
Decided to try reinstalling Office 97.

First attempt (just added stuff that was not previously installed) did
not help.

On second attempt I first removed Office 97 and then reinstalled it.

This seems to have fixed the problem.

note: On the reinstall I chose to install everything.

Perhaps some file was corrupted...
 

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