Login

View Full Version : VBA Macro Not working in Autocad 2012 x32



timlane
2012-06-02, 06:15 PM
We are updating to Autocad 2012 from 2009. Our new computers are running Win 7 x64 and our older machines are XP x32 machines. I have installed Autocad & VBA Enabler on several Win 7 x64 machines using the save acad.dvd file from autocad 2009 and everything is working fine. Today I am upgrading and older XP x32 machine with the 32bit version of Autocad & VBA Enabler with no success. I keep getting compile errors. Does anybody know why this might be happening?

arshiel88
2012-06-03, 06:08 AM
Check for any missing references in VBA IDE.

Is your VBA project specifically made for 64-bit? Because there are methods/statements that will work only for 64-bit, (e.g. ObjectID32), even if you check for the platform before issuing the statement, still it won't pass the compiling process.

hugh.69031
2012-06-04, 03:50 AM
Alt-D, Alt-L in the Visual Basic Editor detects lurking surprises.

timlane
2012-06-04, 02:40 PM
The VBA code is the same one I was using for Autocad 2009 x32 so no platform specific statements have been added. Do I need to create a different macro for the 32bit system since this one is being used on 64bit systems? Any other ideas would be great.

Ed Jobe
2012-06-04, 03:29 PM
First try arshiel's first suggestion. In the ide, go to Tools>References and look for item starting with "MISSING-". Note: you aren't going to be able to use the same dvb on both systems. That means you can't use the same file from a shared location. This is what usually causes these problems. When acad opens an old dvb, it compiles it for the current version, in this case, x64. Now it won't work on x86. Fix the missing reference and do a SaveAs. If you want to keep the same filename, eg acad.dvb, move the x86 version to a folder that is higher up in the file search path so it gets found first.

timlane
2012-06-06, 12:05 AM
Thanks for your help. I finally created another copy of the acad.dvd file and placed it into s seperate folder which loads first. Since this file was created using the 32 bit version of Autocad it works like it should. I didn't know that the 32 bit and 64 bit versions could not use the same VBA file like they do with other files.

Ed Jobe
2012-06-06, 02:18 PM
I didn't know that the 32 bit and 64 bit versions could not use the same VBA file like they do with other files.The reason is that a dvb isn't just the code you see in the IDE. It also contains the compiled code. Think of it as a dll + text. Maybe that helps clear up my previous explanation.