Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel ActiveX ControlBox Cannot Insert Object error

Status
Not open for further replies.

hotbread

Technical User
Mar 13, 2006
42
AU
Hi,

Every time I try to insert an ActiveX control (eg command button) from the control toolbox onto an Excel worksheet, I get the error "Cannot Insert Object". I've spent two hours searching the internet for a solution and nothing seems to help. I thought I may need to register an ocx file, but if so, I don't know what it's called. I tried registering the fm20.dll file, but I still get the error after doing that. Does anyone have any suggestions? This problem also prevents me from running macros in existing workbooks that have ActiveX controls, returning "unexpected error (32811)".

Tim
 
Hi

Reinstalllig MS Office package may solve this problem.

Stefen
 
Thanks Stefen. Actually, the problem seemed to fix itself - when I turned my computer on today I was able to place activex controls on worksheets in new and existing workbooks. Perhaps it had something to do with re-registering the fm20.dll, requiring the computer to be restarted? The only problem now is that error message "unexpected error 32811" occurring in a particular workbook - the problem part of the code seemed to be the sheet reference. That is, my code said Sheet1.Activate, but the code wouldn't work until I changed it to Worksheets("Sheet1").Activate. Not sure why this is the case considering Sheet1 is the sheet code name and was working perfectly before, but at least I've been able to get it working a different way.

Tim

Tim
 


Sheet1.Activate

and

Worksheets("Sheet1").Activate

are not necessarily statements that do the same thing.

Do you have a worksheet with a CodeName of Sheet1 that also has a Name of "Sheet1"?

If the answer is yes, then the statements will do the same thing.

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Yep, the codename and name are both "Sheet1" - the code Sheet1.Activate was working perfectly up until I upgraded the operating system to Windows7, and then Sheet1.Activate triggered the error. No idea why!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top