RE: Invalid Cast Exception

Sep 2, 2014 at 5:59 AM

I am just trying to make NodeXL's Graph Metrics function work, but when I do, this error message comes up:

![Image](Graph Metrics error message)

The rest of NodeXL seems to work quite well, and I am only having this problem with my own laptop; when I use the same feature on the PCs at my university, this issue does not arise.

I have uninstalled and re-installed NodeXL, with no improvement. I have also done work to ensure that the files are trusted.

Any ideas? I have many assignments I need to make this work for, and it would be helpful if I could do this on my own laptop in my own time.

Thank you in advance! :)
Sep 2, 2014 at 6:06 PM
I was not able to see your error message (Codeplex does not allow it) - can you paste the content of the text of the error?


Sep 14, 2014 at 5:41 AM
My apologies for the delay. The message text I am getting reads as follows:


[Invalid Cast Exception]: Unable to cast COM object of type 'System._ComObject' to interface type 'Microsoft.Office.Interop.Excel._Workbook'.
This operation failed because the Query Interface call on the COM component for the interface with IID '{000208DA-0000-0000-C000-000000000046}'
failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).

at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr&pptTarget, Boolean& pfNeeds release)
at Microsoft.Office.Interop.Excel._Workbook.get_Sheets()
at Smrf.AppLib.ExcelUtil.TryGetWorksheet.(Workbook workbook, String worksheetName, Worksheet&worksheet)
at Smrf.AppLib.ExcelTableUtil.TryGetTable.(Workbook workbook, String worksheetName, String tableName, ListObject&Table)
at Smrf.NodeXL.ExcelTemplate.PerWorkbookSettings.TryGetPerWorkbookSettingsTable(ListObject& oPerWorkbookSettingsTable)
at Smrf.NodeXL.ExcelTemplate.PerWorkbookSettings.GetAllSettings()
at Smrf.NodeXL.ExcelTemplate.PerWorkbookSettings. TryGetValue(String settingName, Type value Type, Object&value)
at Smrf.NodeXL.ExcelTemplate.PerWorkbookSettings.get_WorkbookSettings()
at Smrf.NodeXL.ExcelTemplate.NodeXLApplicationSettingsBase.GetWorkbookSettings()
at Smrf.NodeXL.ExcelTemplate.NodeXLApplicationSettingsBase.CopyWorkbookSettingsToStandardSettings()
at Smrf.NodeXL.ExcelTemplate.NodeXLApplicationSettingsBase.get_Item(String propertyName)
at Smrf.NodeXL.ExcelTemplate.GraphMetricUserSettings.get_GraphMetricsToCalculate()
at Smrf.NodeXL.ExcelTemplate.GraphMetricUserSettings.ShouldCalculateGraphMetrics(GraphMetricsgraphMetrics)
at Smrf.NodeXL.ExcelTemplate.CalculateGraphMetricsContext.ShouldCalculateGraphMetrics(GraphMetricsgraphMetrics)
at Smrf.NodeXL.ExcelTemplate.OverallMetricCalculator2.TryCalculateGraphMetrics(|Graphgraph,CalculateGraphMetricsContext calculateGraphMetricsContext,
at Smrf.NodeXL.ExcelTemplate.GraphMetricCalculationManager.CalculateGraphMetricsAsyncInternal(CalculateGraphMetricsAsyncArgs
oCalculateGraphMetricsAsyncArgs,BackgroundWorker oBackgroundWorker_DoWorkEventArgs oDoWorkEvent Args)
at Smrf.NodeXL.ExcelTemplate.GraphMetricCalculationManager.BackgroundWorker_DoWork(Objectsender, DoWorkEventsArgs e)
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventsArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

That's all (!) that was in the error message.
Oct 20, 2014 at 5:10 AM
Hello, I am also getting the same error message while trying to use the 'Automate' feature.