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
Solved! Go to Solution.
Solved by CattabianiI. Go to Solution.
What's the error you get?
Can you create an iPart (which is based on Excel) in Inventor?
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
Sorry. Didn't see your second question at first. Yes I can create an iPart and even use the "Edit via SpreadSheet."
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
(Not an Autodesk Employee)
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.