montadaa2000

Activating Data Frame

Discussion created by montadaa2000 on Dec 11, 2011
Latest reply on Dec 20, 2011 by sli-esristaff
I wrote two codes for activating the second data frame in arcmap,the first one works on but the second doesn't and I get the error "object doesn't support this action" Iwant to understand why?

1st code:
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument

Dim pMaps As IMaps
Set pMaps = pMxDoc.Maps

Dim pMap As IMap
Set pMap = pMaps.Item(1)

Set pMxDoc.Activeview=pMap

2nd Code:

Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument

Dim pMaps As IMaps
Set pMaps = pMxDoc.Maps

Dim pMap As IMap
Set pMap = pMaps.Item(1)

Dim pActiveView As IActiveView
Set pActiveView = pMap
Set pActiveview.FocusMap=pMap

Outcomes