algorithmic modeling for Rhino
Hello,
I've been using your plugin (TT Toolbox) happily for years now, but recently, a script that had been working fine for multiple users for ages to write data to an Excel sheet started having problems for one user in particular. On his machine, the component returns this error:
Could not open excel. Try opening excel manually and running this component again.
Error: System.InvalidCastException: Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type 'Microsoft.Office.Interop.Excel._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
at Microsoft.Office.Interop.Excel.ApplicationClass.set_Visible(Boolean RHS)
at TToffice.TT_Excel.initNewVisible() in C:\Users\EErtugrul\Documents\GitHub\TTOffice\TTOffice\TT_Excel.cs:line 230
at TTToolbox.writeToExcel.SolveInstance(IGH_DataAccess DA)
It's a Windows 10 machine, Grasshopper and TT Toolbox are updated (and unblocked), and the script HAD been working fine for him up until a few days ago. As near as we can figure, this started after Office 365 was removed from his machine. The machine still has Office 2010 installed (and updated) on it, which can definitely open and function fine on its own.
After many reinstalls and tests, I can no longer think of anything that might help. Any insight into defeating this particular error is much appreciated. Thank you very much.
Tags:
Hi Gwendolyn,
Thanks for your response. We believe that this error is related to the version of Excel you're running on. Would you be able to provide us with the grasshopper definition (or part of) that generates the error?
Cheers,
Emil
Here's the version information for Excel:
And I've attached an extremely simplified Grasshopper definition (and associated Excel file) that demonstrates the behavior I've described: it works fine on everyone's machine but this one person's. In addition to the error described above, it also exhibits errors insisting that it can't find the specified Excel file (when it's definitely there, and definitely under the correct file path) and that it can't open Excel at all (even when I open Excel first myself like the error requests).
Thanks for the files and the info. We'll look into it and get back to you asap!
Cheers,
Emil
Thank you very much; there is a lot of data just waiting to get input, so I'm very eager to resolve this error.
Hi Gwendolyn,
We've tried hard to recreate this issue using different versions of Excel, but unfortunately without success. Since this may not be a bug we can fix, have you looked around online for solutions? There seem to be a few who've experienced the same COM cast error and used the process monitor as a tool to solve it. Here for instance:
https://blogs.msdn.microsoft.com/dau-blog/2012/04/20/how-to-solve-u...
Cheers,
Emil
Welcome to
Grasshopper
© 2024 Created by Scott Davidson. Powered by