Error: "Unable to get the Open Property of the Workbook-Object." when opening Excel-File with iLogic

Error: "Unable to get the Open Property of the Workbook-Object." when opening Excel-File with iLogic

Darrell.johnson
Enthusiast Enthusiast
290 Views
2 Replies
Message 1 of 3

Error: "Unable to get the Open Property of the Workbook-Object." when opening Excel-File with iLogic

Darrell.johnson
Enthusiast
Enthusiast

Hello, I get this error when opening an Excel-file with iLogic.

 

Darrelljohnson_1-1674136647011.png

Unable to get the Open Property of the Workbook-Object.

 

Here is my code:

'define the file to create/open
myXLS_File = "C:\Users\Darrell.Johnson\Desktop\V1000101_20230119_105452.xlsm"

'Get the Inventor user name From the Inventor Options
myName= ThisApplication.GeneralOptions.UserName

'define Excel Application object
excelApp = CreateObject("Excel.Application")
'set Excel to run visibly, change to false if you want to run it invisibly
excelApp.Visible = True
'suppress prompts (such as the compatibility checker)
excelApp.DisplayAlerts = False

'check for existing file 
If Dir(myXLS_File) <> "" Then
'workbook exists, open it
excelWorkbook = excelApp.Workbooks.Open(myXLS_File)
ExcelSheet = excelWorkbook.Worksheets(1)
Else
'workbook does NOT exist, so create a new one
excelWorkbook = excelApp.Workbooks.Add
End If

'Insert data into Excel.
A9 = excelWorkbook.Worksheets("Maßtabelle").Range("I11").Value
 
'close the workbook and the Excel Application
'uncomment if you want to close the xls file at the end
excelWorkbook.Close
excelApp.Quit
excelApp = Nothing   

 

The code worked just fine before the Windows update yesterday.

0 Likes
Accepted solutions (1)
291 Views
2 Replies
Replies (2)
Message 2 of 3

Cadkunde.nl
Collaborator
Collaborator
Accepted solution

There is nothing wrong with the code.

 

Maybe repair your office.

Controlpanel --> add/remove programs --> select office --> Remove/Repair --> choose Repair

0 Likes
Message 3 of 3

Darrell.johnson
Enthusiast
Enthusiast

I repaired my Office as you mentioned, now everthing is working again. Thank you!

0 Likes