TheSwamp

Code Red => VB(A) => Topic started by: Bobby C. Jones on August 02, 2011, 04:53:14 PM

Title: What version kicked VBA out?
Post by: Bobby C. Jones on August 02, 2011, 04:53:14 PM
Or to rephrase the question, what is the latest version of AutoCAD that runs VBA in-process?  Thanks guys...it's heck getting old! 

I hope I remember to come back and check on this thread...
Title: Re: What version kicked VBA out?
Post by: Chris on August 03, 2011, 08:42:29 AM
I think 2010 was the first that you had to download a separate file/plugin to get VBA to work.
Title: Re: What version kicked VBA out?
Post by: Bobby C. Jones on August 03, 2011, 09:50:38 AM
I think 2010 was the first that you had to download a separate file/plugin to get VBA to work.

Thanks Chris.  That's what I was thinking as well...and it doesn't bode well for me.  Oh well, it's an opportunity to do something great, right  :-)
Title: Re: What version kicked VBA out?
Post by: Matt__W on August 03, 2011, 10:44:26 AM
I think 2010 was the first that you had to download a separate file/plugin to get VBA to work.

Thanks Chris.  That's what I was thinking as well...and it doesn't bode well for me.  Oh well, it's an opportunity to do something great, right  :-)
Or fail miserably trying.
Title: Re: What version kicked VBA out?
Post by: Bobby C. Jones on August 03, 2011, 12:41:57 PM
Or fail miserably trying.

And there's always that option  :-)
Title: Re: What version kicked VBA out?
Post by: n.yuan on August 03, 2011, 03:54:30 PM
VBA being separated download (starting from AutoCAD2010) does not mean it not run in AutoCAD as in-process. prior to Acad2012 release, rumor has it that Acad2011 would be the last version that supoort VBA, which has been proved wrong: Acad2010 still support VBA. Due to Acad's 3-year version compatibility tradition, now we would guess VBA suppoting might be gone froom Acad2013, but who knows (someone who really knows it would not allowed to say, right?)

Back to the origianl question: all latest version of AutoCAD (up to Acad2010) supports VBA as in-process, as long as you use Acad 32-bit version (again, it has nothing to do with VBA having to be downloaded and installed separately), while if you use Acad 64-bit version, VBA runs as out-process with AutoCAD. It is due to the fact that VBA lisenced from Microsoft is not not supported by 64-bit OS.
Title: Re: What version kicked VBA out?
Post by: Bobby C. Jones on August 03, 2011, 05:04:39 PM
Back to the origianl question: all latest version of AutoCAD (up to Acad2010) supports VBA as in-process, as long as you use Acad 32-bit version (again, it has nothing to do with VBA having to be downloaded and installed separately), while if you use Acad 64-bit version, VBA runs as out-process with AutoCAD. It is due to the fact that VBA lisenced from Microsoft is not not supported by 64-bit OS.

My bad Norman, I should have mentioned that we are interested in the x64 version.
Title: Re: What version kicked VBA out?
Post by: MexicanCustard on August 04, 2011, 12:56:57 PM
If you type VBAMAN at the command line, if VBA is not installed an Alert Box with a web link will appear. Click the link and you'll launch a web page that has both 32 bit and 64 bit versions available. Install which ever is relevant and it should run your VBA stuff just fine or at least until 2013 comes out.
Title: Re: What version kicked VBA out?
Post by: Bobby C. Jones on August 04, 2011, 03:57:27 PM
If you type VBAMAN at the command line, if VBA is not installed an Alert Box with a web link will appear. Click the link and you'll launch a web page that has both 32 bit and 64 bit versions available. Install which ever is relevant and it should run your VBA stuff just fine or at least until 2013 comes out.

I've heard, but not yet experienced, that the 64 bit version runs noticeably slower.  Have you experienced that?  Thanks.
Title: Re: What version kicked VBA out?
Post by: Jeff H on August 04, 2011, 04:29:58 PM
The problem is MicroSoft never ported VBA to 64-bit.
64-bit can run both 32 and 64-bit but you can not load a 32-bit dll in a 64-bit process and vice versa

So for 64-bit Autocad to use VBA it uses the 32-bit VBA version in a out-of-process 32-bit COM server

And then they blame the Performance hit on Marshalling (http://en.wikipedia.org/wiki/Marshalling_(computer_science))
Title: Re: What version kicked VBA out?
Post by: Bobby C. Jones on August 04, 2011, 05:08:06 PM
And then they blame the Performance hit on Marshalling (http://en.wikipedia.org/wiki/Marshalling_(computer_science))

Has anyone done any profiling to get a number for just how big a hit this causes?  I'm not considering going this route, but I do need to justify to management why we need to go a different direction...and numbers tend to impress them, if not outright confuse them.
Title: Re: What version kicked VBA out?
Post by: Dave R on August 09, 2011, 08:53:53 AM
And then they blame the Performance hit on Marshalling (http://en.wikipedia.org/wiki/Marshalling_(computer_science))

Has anyone done any profiling to get a number for just how big a hit this causes?  I'm not considering going this route, but I do need to justify to management why we need to go a different direction...and numbers tend to impress them, if not outright confuse them.

I threw VBA over the side with 2010. We migrated to Win7-64 and had nothing but crashes and hangs in AutoCAD with VBA installed. So I re-wrote all our macros in C# and it's been rock solid ever since. Not to mention a heck of a lot faster.