New to ArcMap VBA

11756
31
02-08-2016 11:55 AM
EthanDunker
New Contributor II

Hello,

I am new to ArcMap VBA coding and was wondering if there is any good websites to help me understand what I am doing wrong. I have a basic knowledge of VBA for coding in access.

thanks in advance

0 Kudos
31 Replies
RebeccaStrauch__GISP
MVP Emeritus

Just curious why you are going with VBA and not the newer Python (arcpy)?  What version of ArcMap are you using?

Also, what are you trying to do with the code?  Are you just using it in the field calculator?  Or are you trying to create a tool?

EthanDunker
New Contributor II

The only reason I am using VBA is due to the experience I do have with it. I am trying to create a tool. Or rather copy a tool from a ArcMap that my office has. but it has an error in it.

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

Good reason (although long term, I would suggest thinking about a switch...just because many more resources).

It would help if you could post a snapshot of the error you are getting.  Depending on the version of ArcMap, and when it was installed, it may be that you just need to install the "VBA compatibility" for the version.  This can be downloaded in the myesri page under the "additiona products" for the ArcGIS version you have installed.

If you aren't the esri license manager/administrator, you may need to go ask them for permission or to download it for you.

I would also try doing a browser search for something like "esri vba help"

Hope that helps.

EthanDunker
New Contributor II

I posted another question in here last week with the code and error and more info on it. its Help with Run time error 91.

JoeBorgione
MVP Emeritus

Rebecca is spot on; python is well worth your while to pursue.  It'll be the thing until the next big thing comes along, which has already happened to VBA.

That should just about do it....
0 Kudos
EthanDunker
New Contributor II

Does python have the ability to open microsoft access database?

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

I don;t have any experience with that so I'll bow out, but didn't did find this

https://wiki.python.org/moin/Microsoft%20Access

re: python.

Might be a different answer if you are talking personal GDB that used Access.  I'll let Dan Patterson​ or some of the other python-heads get into that.  Might be more than you need re: you original question.  But I bet the link to the other question you have could be re-written by someone in python (I have no time right now to get into it)

XanderBakker
Esri Esteemed Contributor

You could use pypyodbc 1.1.5 : Python Package Index to work with Access files in Python, but I also see you have forms in the code you posted here Help with Run time error 91 . I didn't look at it in detail and I don't use ArcObjects anymore.

I do believe there is a lot you can do with Python and it is better prepared for the future (VBA will disappear).

AdrianWelsh
MVP Honored Contributor

I was once big time into VBA so I feel your pain in trying to switch over to something else. But, like others have said, it is time to make the switch and I would recommend Python.

I am not fully sure on opening MS Access with Python but I found this website that mentions how to connect to an Access database so I would imagine that this would be able to direct you in the path you want to go:

http://stackoverflow.com/questions/1047580/ms-access-library-for-python

0 Kudos