I just upgraded from ArcGIS 9.2 to 10.0, and I'm trying to create some tools using VBA. It doesn't recognize any of the ArcObjects Classes, Interfaces, or Constants unless the reference includes its library name. For example:

Dim pMxDoc as IMxDocument
Set pMxDoc = ThisDocument

doesn't work, but

Dim pMxDoc As esriArcMapUI.IMxDocument
Set pMxDoc = Project.ThisDocument


Does anyone know how to fix this? (FYI I have no admin capabilities on this computer.)

  • This really isn't an ArcGIS 9.2 question. I don't know why that tag was added. – Bjorn Jan 23 '13 at 15:08

The dll library directory location and the dll in general have changed going from v9 to v10. I've come across this problem before migrating a .NET Visual Studio project setup from v9 to v10. In my case I just removed the library and added it back in, and it worked fine. I believe in VBA you can only check these libraries on or off, not add and remove them. If your mxd that has the code in it is v9 you might want to convert it to v10 mxd. I would suggest for you to migrate your code into a Visual Studio Add-In project since v10.1 does not support VBA.

Here are some helpful migration links:

Type changes between 9.3 and 10

Migrating VBA customizations to ArcGIS 10

| improve this answer | |
  • I am writing the code from scratch, or importing it into VBA from a text file. I'm not opening an existing 9.2 project with 10.0, and editing the code. – Bjorn Jan 23 '13 at 13:24
  • Code completion works if the library name isn't used, but the code will fail upon execution. – Bjorn Jan 23 '13 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.