VBA - Application.Templates -method or data member not found?

2357
3
03-09-2012 01:14 AM
CecileHerr
New Contributor
Hello

A beginner's question.

I still use an old VBA script in ArcGIS 9, with a code line getting the document path :

DocAbsPath = Application.Templates.Item(Application.Templates.Count - 1)


Since we have installed ArcGIS 10, I get the error "method or data member not found" for the part:  Application.Templates

Any suggestion about this ?

Many thanks in advance !
Cécile
0 Kudos
3 Replies
DuncanHornby
MVP Notable Contributor
Cécile,

Have you tried to recompile your VBA project? Go into VBA editor and click on the menu option Debug > Compile Project. If it bombs out at the same line I recon you have some sort of namespace conflict. In this case prefix it with the object library as shown below

MsgBox esriArcMap.Application.Templates.Item(esriArcMap.Application.Templates.Count - 1)


Duncan
0 Kudos
CecileHerr
New Contributor
Thank you for the answer.
I got this error while trying to compile my code (only with ArcGIS 10, it is ok with ArcGIS 9).
I do not have access to arcGIS 10 until Monday, but I will try your suggestion!

Cécile
0 Kudos
CecileHerr
New Contributor
Duncan, you were absolutely right, your suggestion does the trick!

Many thanks!
Cécile
0 Kudos