Ilogic: Excel sheet not found happening only some of the time

Ilogic: Excel sheet not found happening only some of the time

Thomas.Long
Advocate Advocate
876 Views
8 Replies
Message 1 of 9

Ilogic: Excel sheet not found happening only some of the time

Thomas.Long
Advocate
Advocate

I just recently switched to inventor 2019 and I have a program I've been using for some time that's now running into some issues. The difficulty is that it only runs into them some of the time, which is making no sense to me.

 

The program uses a series of look ups from excel sheets in order to generate models. However one excel sheet has started throwing errors when I'm initializing the file.

 

MultiValue.List("ChannelSize") = GoExcel.CellValues("N:\Mechpart\TLONG\Reference Materials\Information\BEAM INFORMATION.xlsx", "Beam Size List", "A1", "A290")

 

It will say that the sheet can't be found. However, I know for a fact it can be found. I've not only triple checked the reference, but if I close inventor and reopen it, it will suddenly work again without any changes to the program. I know it isn't an issue of the file being in use by another user because the program will continue to throw the error every time after the initial error until inventor is restarted, at which point it instantly runs fine, as if my inventor is continuing to hold onto the file after I run the program the first time. But its a basic iLogic function so it shouldn't be causing that issue right?

 

Has anyone else run into an error like this? Does anyone know why it is causing this issue?

 

Thank you,

Thomas Long

0 Likes
877 Views
8 Replies
Replies (8)
Message 2 of 9

MjDeck
Autodesk
Autodesk

Does the same rule read data from other sheets, or is that the only one?
Can you share the Excel file?


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 3 of 9

bradeneuropeArthur
Mentor
Mentor

using directory name may be the issue like N:\

Use server name instead and the issue may be vanished like //10.120.155.23 or equal

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 4 of 9

WCrihfield
Mentor
Mentor

Are you opening the Excel file somehow within your code, or just directly accessing values from within it, without opening it?  If you are opening the Excel file within your code, are you also closing it within your code?

Have you tried looking at the Task Manager's Processes tab to see if your Excel application is still running after the code has finished?  If it is still running, try closing Excel normally (if it is visible in the task bar), or try using End Task to close it. Give it a little time to process the Close (or End Task) order.  Then, without closing or restarting Inventor, after you've ran the code at least once before, try your code again, to see if it acts any differently.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 9

Thomas.Long
Advocate
Advocate

This rule opens multiple excel sheets. This is the only one throwing this issue. However this one is also the only one that calls the Multivalue from excel function.

 

Thank you,

Thomas Long

Edit: Attached is the excel sheet. I removed any columns which might be proprietary.  It's only giving the error when accessing sheet 3.

0 Likes
Message 6 of 9

Thomas.Long
Advocate
Advocate

Ok. I'll see if I can't find that information. Is that new? This worked for years on the 2013 version with no issues.

0 Likes
Message 7 of 9

Thomas.Long
Advocate
Advocate

I checked this at first because I thought this might be the issue as well, but even going back and testing now, I can see it open the only excel process, throw the error, then I have to go back and close it. So the error will still go off without any other processes accessing the workbook.

0 Likes
Message 8 of 9

WCrihfield
Mentor
Mentor

I downloaded your Excel file to my Desktop.  Opened an existing test part file. Created a Text type parameter named "ChannelSize" within it.  Created a new local iLogic rule within the part.  Copied & pasted your code into the rule.  Modified the path to match my Desktop location (and the "Copy of" portion of the document name).  Ran the rule, and it worked for me.  When I looked at the parameters dialog box afterwords, it populated the Multivalue list within that parameter, as expected.

PS. I ran it several times more too, just to be sure, due to the nature of the issue.  But no problems, so far.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 9 of 9

Thomas.Long
Advocate
Advocate

Ok, thank you. Let me look into it this week and see if it wasn't maybe file based or something. I thought I checked it on other files, but I'll go back and look again and see if it starts causing that issue in other files.

 

Thank you,

Thomas Long

0 Likes