Help with an Excel Interop DLL error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Community,
I am developing an iLogic rule to read/import data from an Excel file.
The rule works fine on a computer that has Office 365 installed and Inventor 2022.4.1.
A "System.Runtime.InteropServices.COMException: Invalid Index" error occurs when the rule is run on a computer with Office 2016 and Inventor 2022.3.1.
Any assistance to diagnose or resolve the error would be appreciated.
Here is the code that accesses the XLSX file:
Dim oXLFile As String = "C:\Users\jberns\Downloads\Civil 3D Output file.xlsx"
Dim oSheet As String = "Combined_Data"
Dim oExcel As New Microsoft.Office.Interop.Excel.ApplicationClass
oExcel.DisplayAlerts = False
oExcel.Visible = False
Dim oWB As Workbook = oExcel.Workbooks.Open(oXLFile)
Dim oWS As Worksheet = oWB.Worksheets.Item(oSheet)
Here is the error:
Why would the different versions of Office or Inventor updates cause this error when getting worksheet names?
Can the DLL from PC1 be copied to PC2 and resolve the issue? I certainly don't want to corrupt the Office installation.
As other users test this rule, I wonder how many other similar errors will occur.
Thank you for your time and attention. I look forward to your replies.
Regards,
Jerry
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional