![]() |
Cannot insert object when I update version
I have an ActiveX control that I developed with ATL that I recently enhanced. I updated the type library version from 1.6 to 1.7.
The new control works fine with Visual Basic and Internet Explorer. However when I try to load it into Excel I get the message "Cannot insert object". I assumed the problem was a mismatch between the version of the type library and a version specified in the header for the control. However synchronizing them did not help. Someone on the vc.atl board suggested that Excel might be caching the old type library. How can I check this? Does anyone have any other ideas what might be causing this problem? |
Cannot insert object when I update version
Nothing in the KB on the lastest version, but for Office 97, there were some
restrictions. http://support.microsoft.com/default...&Product=ofw97 XL97: Error Inserting ActiveX Object in a Worksheet http://support.microsoft.com/default...&Product=ofw97 OFF: .Exd Files Are Created When You Insert Controls another possibility: http://support.microsoft.com/default...80&Product=ofd PRB: Error Message "Cannot insert object" in Excel -- Regards, Tom Ogilvy "DogMan" wrote in message ... I have an ActiveX control that I developed with ATL that I recently enhanced. I updated the type library version from 1.6 to 1.7. The new control works fine with Visual Basic and Internet Explorer. However when I try to load it into Excel I get the message "Cannot insert object". I assumed the problem was a mismatch between the version of the type library and a version specified in the header for the control. However synchronizing them did not help. Someone on the vc.atl board suggested that Excel might be caching the old type library. How can I check this? Does anyone have any other ideas what might be causing this problem? |
Cannot insert object when I update version
Thanks for the suggestions, Tom. Unfortunately none of the 3 suggestions applied.
I have been working on this problem with the assumption that it has something to do with your 3rd suggestion, but it seems to be something else. "Tom Ogilvy" wrote: Nothing in the KB on the lastest version, but for Office 97, there were some restrictions. http://support.microsoft.com/default...&Product=ofw97 XL97: Error Inserting ActiveX Object in a Worksheet http://support.microsoft.com/default...&Product=ofw97 OFF: .Exd Files Are Created When You Insert Controls another possibility: http://support.microsoft.com/default...80&Product=ofd PRB: Error Message "Cannot insert object" in Excel -- Regards, Tom Ogilvy "DogMan" wrote in message ... I have an ActiveX control that I developed with ATL that I recently enhanced. I updated the type library version from 1.6 to 1.7. The new control works fine with Visual Basic and Internet Explorer. However when I try to load it into Excel I get the message "Cannot insert object". I assumed the problem was a mismatch between the version of the type library and a version specified in the header for the control. However synchronizing them did not help. Someone on the vc.atl board suggested that Excel might be caching the old type library. How can I check this? Does anyone have any other ideas what might be causing this problem? |
Cannot insert object when I update version
Hi
First of all, I would like to confirm my understanding of your issue. From your description, I understand that you have an ATL control of version 1.6 which works fine when you insert it into the Excel worksheet. Afterwards, you make some changes to the control and change the version to 1.7, the you will get the error message "Cannot insert object". Have I fully understood you? If there is anything I misunderstood, please feel free to let me know. Have you changed the progid or GUID, when you change the version? To isolate the problem, you may try to insert the original version to see if the problem occurred. Try to recreate a new ATL object and use a new progid and GUID with the changed version's code, did the problem persists? You may have a try and let me know the result. Also can you make a simple reproduce sample and send to me by removing the "online" from my email address? Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
Cannot insert object when I update version
Hi
Yes, you understand correctly. The funny thing is if I take the new control and set the library version back to 1.6, Excel succeeds in inserting it. Do you mean the 1.7 an 1.6 controls are of the same progid and guid, is so, there may confusion between the two versions, you may try to use the filemon and regmon to see what is the dll the excel is going to load and what clsid(GUID) and progid the excel is loading. You may get the two tools in the website below. http://www.sysinternals.com/ My first attempt at changing the progids and GUIDs failed . . . the new control would not load at all regardless of the library version. I suspect I missed something. I will continue working on this and get back to you. Do you mean recreate a new control(different GUID and progid) will not work? This is strange because this should have no relation with the 1.6 and 1.7 control, it is just a new control which does the same job with the 1.6 and 1.7. You may try to recreate a new control with the wizard and did not add any special code and then add the additional code one by one to see which cause the problem. I look forward to your further response. Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
Cannot insert object when I update version
Hi
Stranger and stranger! I tried installing the control on a fresh machine, one on which the control has never been installed. Inserting it into Excel failed. That eliminates cached control information or remnants hanging around in the registry as being the problem. From your description, I understand that the com object of new version will work on certain machine after re-register. On the new installed machine, there will be no information about the com object in the registry, so the error is expected. Also you may try to register the com object to see if the problem persists. [NOTE] It seems that this is a big project, so you may try to check if the com object will need other com library or dll and etc, and that is why I suggest you use the filemon and regmon to locate if this is the problem. Since I can not reproduce the problem on my side, it is hard to guess what is the problem. I will appreciate if you can make a simple and easy reproduce project. Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
Cannot insert object when I update version
Hi,
Please feel free to post your test result here and we will follow up. Thanks. Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
Cannot insert object when I update version
Hi,
Since the excel on two machine are both installed sp2, the minor version difference may caused by you have installed some hotfixs on one machine. So we have no data about what hotfixs will produce such version, but you may try to install more hotfix on the lower version excel to see if we can make the version to match. Anyway, since the problem did not occur on the simple control the problem may be caused by how we make the large "problem" control, so I look farward to that you can provide a reproduce sample which will help us locate the problem. Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
Cannot insert object when I update version
Hi,
By the way, you can try http://office.microsoft.com/officeup...lt.aspx?CTT=98 to update your office to the latest version by using "check for updates" feature there. Thanks. Best regards, Yanhong Huang Microsoft Community Support Get Secure! ¨C www.microsoft.com/security Register to Access MSDN Managed Newsgroups! -http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as p&SD=msdn This posting is provided "AS IS" with no warranties, and confers no rights. |
Cannot insert object when I update version
I made an interesting discovery. When I set the type library version to 1.7,
my control no longer shows up in Visual Basic's list of controls (Project | Components or ^T). If I set it back to 1.6, it does show up. What determines when a control shows up in Visual Basic's list? "Yan-Hong Huang[MSFT]" wrote: Hi, By the way, you can try http://office.microsoft.com/officeup...lt.aspx?CTT=98 to update your office to the latest version by using "check for updates" feature there. Thanks. Best regards, Yanhong Huang Microsoft Community Support Get Secure! ¨C www.microsoft.com/security Register to Access MSDN Managed Newsgroups! -http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as p&SD=msdn This posting is provided "AS IS" with no warranties, and confers no rights. |
Cannot insert object when I update version
Well, I found the problem with the control not showing up in VB's control
list . . . the Version entry in the rgs file for the control refers to the type library version, not the version of the control. Updating it to 1.7 solved the VB problem. Unfortunatley it did not resolve the Excel problem. "DogMan" wrote: I made an interesting discovery. When I set the type library version to 1.7, my control no longer shows up in Visual Basic's list of controls (Project | Components or ^T). If I set it back to 1.6, it does show up. What determines when a control shows up in Visual Basic's list? "Yan-Hong Huang[MSFT]" wrote: Hi, By the way, you can try http://office.microsoft.com/officeup...lt.aspx?CTT=98 to update your office to the latest version by using "check for updates" feature there. Thanks. Best regards, Yanhong Huang Microsoft Community Support Get Secure! ¨C www.microsoft.com/security Register to Access MSDN Managed Newsgroups! -http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as p&SD=msdn This posting is provided "AS IS" with no warranties, and confers no rights. |
Cannot insert object when I update version
Hi
Since so far I can not reproduce the problem on my side, I am not sure what is cause of the problem. Have you tried my suggsetion that use the filemon and regmon to monitor the procedure of insert the object in the excel which works on some machines but not on others, which may help us to narrow down the problem you may have a try and let me know the result. Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
Cannot insert object when I update version
Hi,
Thank you for your input. Now I am researching the problem that excel did not create the .exd file, so far I did not find a known issue on this problem. You may check if the TEMP directory has been set by running the code in the command line. echo %TEMP%,%TMP% and check if excel has the right permission for the directories. Also did the problem that excel did not create the .exd file persists with all the ActiveX control, or specified to the problem activex control you mention in your post? Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
Cannot insert object when I update version
Hi Peter,
The settings of TEMP and TMP are correct. Excel does have write permission for the Excel8.0 directory. This problem is specific to my control. I tried inserting the Calendar Control. An .exd file was created for it. Regards. ""Peter Huang"" wrote: Hi, Thank you for your input. Now I am researching the problem that excel did not create the .exd file, so far I did not find a known issue on this problem. You may check if the TEMP directory has been set by running the code in the command line. echo %TEMP%,%TMP% and check if excel has the right permission for the directories. Also did the problem that excel did not create the .exd file persists with all the ActiveX control, or specified to the problem activex control you mention in your post? Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
Cannot insert object when I update version
Hi,
Now I am researching the problem about the .exd file and I will update you with new information ASAP. Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
Cannot insert object when I update version
Hi,
I am sorry for delay reponse. EXDs are extended type libraries, so the problem is likely with loading/parsing his typelib. I think you may have a try to see if OLE/COM viewer(oleview.exe) can open and parse his library. If it fials, the error is likely the important part. You may also try to rebuild the ATL to generate a new one to see if the problem persist. Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
Cannot insert object when I update version
Hi,
I am sorry that I did not make the thing more clear. The .exd file is generated by Excel by parsing the typelib of the ATL control, if there is any error the .exd may not be generated. So to verify the problem, you may try to use Oleview can to read the typelib of the atl control, it may be shipped with the atlcontrol. You may try to open the *.dll with the oleview directly to see if there is any error occur which prevent the .exd file to be generated. Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
All times are GMT +1. The time now is 05:23 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com