Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.)

share|improve this question
    
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
add comment

1 Answer

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

share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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