1

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.

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

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

1 Answer 1

2

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

2
  • 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, 2013 at 13:24
  • Code completion works if the library name isn't used, but the code will fail upon execution.
    – Bjorn
    Jan 23, 2013 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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