Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VBA code all of a sudden stopped working opening a new excel spreadsheet.

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
shastu
1089 Views, 6 Replies

VBA code all of a sudden stopped working opening a new excel spreadsheet.

I have some VBA code within an Inventor module that used to work just fine and now all of a sudden it doesn't.  I can run the exact same code in a WORD document and it works.  So just doing this used to work within an Inventor macro but now it doesn't:

 

Sub TESTEXCEL()

Dim oExclApp As Excel.Application
Set oExclApp = New Excel.Application
oExclApp.Visible = True

End Sub

6 REPLIES 6
Message 2 of 7
CattabianiI
in reply to: shastu

What's the error you get?

Can you create an iPart (which is based on Excel) in Inventor?

Message 3 of 7
shastu
in reply to: shastu

shastu_0-1631196967387.png

 

Message 4 of 7
CattabianiI
in reply to: shastu

The only thing I can do is redirect you here: https://forums.autodesk.com/t5/inventor-ilogic-api-vba-forum/quot-excelobject-workbooks-open-quot-su...
and quote @johnsonshiue:

I was not aware of the issue. Based on your description, it seems that the failure can be reproduced with Inventor and AutoCAD. It sounds like there is a general communication between Windows apps. The first thing I would do is to install all critical Windows updates. We have been impacted by some regressions in Windows updates. Microsoft usually fixes it in a timely matter, particular when affecting many users.

Another possibility is due to change in security policy. Though I don’t have a solid proof, I notice that the newer Windows versions have tighter user security control. It does not seem to like App A to launch App B in certain cases. You may want to make sure you run Inventor and AutoCAD “as admin.”

Lastly, it is possible the Microsoft Office was not installed or registered properly. You may need to uninstall Office and reinstall it. Also, register Inventor using the following command.

 

Go to CMD. Copy and paste the exact statement (replace 20xx with your current version).

“C:\Program Files\Autodesk\Inventor 20xx\Bin\Inventor.exe” /install








Message 5 of 7
shastu
in reply to: CattabianiI

Sorry.  Didn't see your second question at first.  Yes I can create an iPart and even use the "Edit via SpreadSheet."

Message 6 of 7
WCrihfield
in reply to: shastu

Just in case it's one of those things that's so obvious you can't see it...🤔

Have you checked that the reference to the Microsoft Excel XX.X Object Library is still turned on, within the Tools tab, References dialog?  Make sure the correct VBA project is selected before opening that dialog to check.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 7 of 7
shastu
in reply to: WCrihfield

Good thought, but if that was the case it would have failed at the Dim line but it wasn't failing until the Set command.  Anyway, I did a repair on office like was suggested and that resolved it for now.  That is quite annoying because you have to get out of all office applications to do that and so it has to be done separately for everyone.  Very time intensive and an interruption for everyone.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report