ERROR
This article was contributed by Esri Singapore.VBA code that was created in ArcGIS 9.3 may return the following error in ArcGIS 10. "Error 13: Type mismatch"
When code created with ArcGIS 9.3 contains the following lines and is run in ArcGIS 10, a mismatch error is returned.
Code:
Public Sub Run()
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument
Dim pPageLayout As IPageLayout
Set pPageLayout = pMxDoc.PageLayout
Dim pPage As IPage
Set pPage = pPageLayout.Page '** error occurs here **
End Sub
Code:
Dim pPageLayout As esriCarto.IPageLayout
Set pPageLayout = pMxDocument.PageLayout
Dim pPage As esriCarto.IPage
Set pPage = pPageLayout.Page
Article ID:000011449
Get help from ArcGIS experts
Download the Esri Support App