COREstudio

The CORE studio at Thornton Tomasetti uses Grasshopper everyday to enhance workflows amongst many engineering disciplines. We draw a lot of help and inspiration from this community and hope that you will find some of the tools that we have created helpful, too.

Excel Error

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.

  • up

    emlplsn

    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

    4