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.)
-
This really isn't an ArcGIS 9.2 question. I don't know why that tag was added.Bjorn– Bjorn2013年01月23日 15:08:11 +00:00Commented Jan 23, 2013 at 15:08
1 Answer 1
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:
-
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– Bjorn2013年01月23日 13:24:32 +00:00Commented Jan 23, 2013 at 13:24
-
Code completion works if the library name isn't used, but the code will fail upon execution.Bjorn– Bjorn2013年01月23日 13:39:06 +00:00Commented Jan 23, 2013 at 13:39
Explore related questions
See similar questions with these tags.