MLCouden

Layers into ArcMAP

Discussion created by MLCouden on Apr 9, 2014
Latest reply on Apr 9, 2014 by ldonahue
I am trying to program to open many different layers in my mxd. I have the one layer code working but I am not sure how to mark for several layers. I was thinking just adding 1,2, etc... to the code so it knows what layer to open, but I am getting runtime error. Please help!
[CODE]
Private Sub CmdMap_Click()

Dim pGxLayer As IGxLayer
Set pGxLayer1 = New GxLayer

Dim pGxFile1 As IGxFile
Set pGxFile1 = pGxLayer1

'Set pGxFile1 = pGxLayer1
'Set pGxFile2 = pGxLayer2
'Set pGxFile3 = pGxLayer3
'Set pGxFile4 = pGxLayer4
'Set pGxFile5 = pGxLayer5
'Set pGxFile6 = pGxLayer6
'Set pGxFile7 = pGxLayer7

pGxFile1.Path = "K:\TASS\2 - GEO-DATA PROCESSING SUPPORT\MICHELLE'S WORK_ENTER NOT!!\Permanent_Stations Program for ArcMAP\ATR.lyr"

'pGxFile1.Path = "K:\TASS\2 - GEO-DATA PROCESSING SUPPORT\MICHELLE'S WORK_ENTER NOT!!\Permanent_Stations Program for ArcMAP\ATR.lyr"
'pGxFile2.Path =
'pGxFile3.Path =
'pGxFile4.Path =
'pGxFile5.Path =
'pGxFile6.Path =
'pGxFile7.Path =

Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument

pMxDoc.AddLayer pGxLayer.Layer
[\CODE]

Outcomes