I just upgraded Inventor from 2012 to 2014. Now when I try to run any of my macros, I get a "Microsoft Visual Basic for Applicaitons" dialog box that reads: "Compile Error: The code in this project must be updated for use on 64-bit systems. Please review and update Declare statements and then mark them with the PtrSafe attribute." This must be a bogus error because I did not go from a 32 bit system to a 64 bit system. I was on a 64 bit system with 2012. All I did was upgrade Inventor from 2012 to 2014.
Solved! Go to Solution.
Solved by shastu. Go to Solution.
While I am not certain about what is causing your problem (perhaps you could post some simple problematic code for us) I do know that Inventor 2012, while it may be installed 64bit, has integration to the VBA environment that is 32bit only. It is for this reason why when you start up VBA (or call anything VBA related) an intermediary process ‘InventorHost32bit’ is launched and runs along side everything.
Below is what it seems to have a problem with:
Public Declare Function GetSaveFileName Lib _ "comdlg32.dll" Alias "GetSaveFileNameA" _ (pOpenfilename As OPENFILENAME) As Long
Public Declare Function GetOpenFileName Lib _ "comdlg32.dll" Alias "GetOpenFileNameA" _ (pOpenfilename As OPENFILENAME) As Long
I went ahead and just put PtrSafe inbetween Declare and Function in both spots and it seems to work now. Didn't think it would be that easy. Is there anything else I should have done?
Hi shastu,
You might search on the Inventor Customization forum, where VBA questions are more likely to have been asked & answered in the past:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120
Here are a couple of links that seems related (I just took a quick glance):
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Can't find what you're looking for? Ask the community or share your knowledge.