9

One of the users of our iGrid ActiveX grid control needs to insert it directly into an MS Excel sheet, but they have not managed to do that - the "Cannot insert object" error is generated all the time. We can also reproduce this problem on our test pc under Win7 64-bit and MS Office 2010 32-bit.

This COM control is properly registered in the OS and can be added to VBA UserForms and other apps, but we cannot do that for an Excel sheets. It seems, it's a common problem for ActiveX's - even legacy ones like Microsoft DataGrid Control 6.0. After searching for a solution for a significant amount of time, we concluded it is a security setting in MS Office. So the question can be formulated as the following: How to enable the usage of specific ActiveX controls in MS Office?

Below are the related resources we found and which might help.

First of all, Microsoft states that

Not all ActiveX controls can be used directly on worksheets; some can be used only on Microsoft Visual Basic for Applications (VBA) UserForms. When you work with these controls, Excel displays the message Cannot insert object if you try to add them to a worksheet.

Does anybody know what missing features might prevent an ActiveX control from being insertable into Excel sheets?

Second, there is a known issue with EXD files used to cache ActiveX controls. But we've checked - that's not our case.

Third, there are two technical articles from Microsoft which explain how to "fix" some ActiveX security problems for ActiveX's using the registry:

PRB: Error Message "Cannot insert object" in Excel
http://support.microsoft.com/default.aspx?scid=kb;EN-US;171280

Cannot insert certain scriptable ActiveX controls into Office 2013 documents
http://support.microsoft.com/kb/2793374

It seems, this also does not help - or we just did something wrong.

And the last thing we tried - the Office Trust Center. Allowing the usage of all ActiveX's without any restrictions and adding the folder with our iGrid ActiveX to the list of trusted location didn't help anyhow.

pnuts
  • 54,806
  • 9
  • 74
  • 122
TecMan
  • 2,347
  • 2
  • 25
  • 57
  • Makes me feel stupid.. the solution for my problem was right there in the link you have mentioned http://support.microsoft.com/kb/2793374 . Tried it. Works! – richie Oct 01 '13 at 06:37
  • @richie, I am using office 2010, not 2013 and i still get this error: "cannot insert object" for active X command button - where i then normally assign a one or more macro's and validation to that button. Does this still Apply? Any ideas, it would be sad if Active X buttons could no longer be used because they are viewed as a security threat. – yoshiserry Feb 17 '15 at 01:36
  • @TecMan: Did you ever resolve this? I'm up against the same problem... – eggyal Mar 24 '16 at 01:28
  • @eggyal, As I remember, I solved the problem by deleting the corresponding .exd file in the directory `C:\Users\\AppData\Roaming\microsoft\forms\`. Let us know whether this works for you. – TecMan Mar 24 '16 at 16:24
  • 1
    @TecMan: Sadly not—I can't even get to the stage where an extended type library (exd) for my control gets written to disk! Excel is aborting with "cannot insert object" on the very first attempt. I have opened a [new question](https://stackoverflow.com/q/36181635); hopefully someone has the answer! – eggyal Mar 24 '16 at 16:58

4 Answers4

15

From Technet Forum

Close Excel.

Start Windows Explorer.

Select your system drive (usually C:)

Use the Search box to search for *.exd

Delete all the files it finds.

Start Excel again.

Stefan Michev
  • 3,938
  • 2
  • 32
  • 29
  • 1
    [Relevent kb article.](http://support.microsoft.com/kb/290537) – Lynn Crumbling Dec 12 '14 at 19:09
  • 1
    Worked! Incredibly helpful because recent automatic Office update caused this problem for me to show up for some users (but not others) out of the blue. Thanks Stefan! – pghcpa Dec 13 '14 at 00:56
3

We have had a similar problem in the past with an ActiveX control that we insert on an Excel sheet from our COM Add-in, and you seem to have touched on two of the items (below) to solve it. The following solves the problem most* of the time.

From Excel 2010: File ribbon; Options; Trust Center; Trust Center Settings (button)...;

  • Add-ins: UNCHECK 'Require Application Add-ins to be signed by Trusted Publisher'.
  • Macro Settings: Ensure it is not disabling all Macros without notification. It is OK if it is set to 'Disable all Macros with notification'.
  • ActiveX Settings: Ensure it is not disabling all controls without notification. It is OK is it is set to 'Prompt me before enabling all controls with minimal restrictions'. THIS WAS THE MAIN CAUSE.
  • Trusted Locations: Add the directory of your control.

Note that some of these are usually not necessary if InstallShield properly registered the containing program (e.g. dll). Also notice that we still allow prompting (probably a good idea to pretect your liability). That has not caused us a problem.

  • However, the reason I am here is that we have one case (out of 200 customers) where the above did NOT work and this just started happening a week ago (it was working for the last 9 months). I am assuming Excel corruption at this point since there were no changes. We have otherwise tried everything. Did you resolve yours?
F Watkin
  • 31
  • 2
  • I have just checked all what you wrote. In my case, the first 3 options were set as you suggested. As for the 4th, I hadn't the path to the OCX in the Trusted Locations list. Added it, but it did not help. – TecMan Oct 02 '13 at 06:57
1

This solved it for me:

Go to the following registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Common\COM Compatibility{8856F961-340A-11D0-A96B-00C04FD705A2}

Then set the value data from 400 to 0.

Hope it helps.

Sorry forgot to give credit for the one who found it. Here. http://social.technet.microsoft.com/Forums/office/en-US/7942c472-2b5a-4005-888f-43ece2a5800a/adding-web-browser-control-to-excel-2013?forum=officeitpro&prof=required

evo
  • 11
  • 2
0

I suffered from this problem the other day and went back to basics with my solution as I don't like the idea of editing the registry.

I solved the problem by simply re-registering the main types of controls I use i.e. Command buttons, Comboboxes, Listboxes, Spinners etc.

To do this go into the Developer tab and click on Insert (a control)

By choosing 'More Controls', in the bottom right-hand corner of the Activex Controls, you can re-register any controls that you might need.