getRow value in data driven pages help

Discussion created by haydlew on Oct 31, 2011
Latest reply on Nov 1, 2011 by haydlew
I have an issue trying to get the value of the "WP_NO" field from the index layer.

[HTML]import arcpy, time
mxd = arcpy.mapping.MapDocument(r"F:\TEMP\STRATEGIC_CONN_MAPBOOK_2011_TEST1.mxd")
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
pageName = mxd.dataDrivenPages.pageRow.getValue("WP_NO")
print pageName[/HTML]

I have also unsuccessfully tried pageName = mxd.dataDrivenPages.pageRow.index

The error I always get is this:
File "C:\Python26\ArcGIS10.0\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 312, in RunScript
exec codeObject in __main__.__dict__
File "F:\SCRIPTS\CHARTS\DATADRIVENPAGES_test.py", line 5, in <module>
pageName = mxd.dataDrivenPages.pageRow.getValue("WP_NO")
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\arcobjects\arcobjects.py", line 945, in getValue
return convertArcObjectToPythonObject(self._arc_object.GetValue(*gp_fixargs(args)))
RuntimeError: ERROR 999999: Error executing function.