POST
|
No more error, but when I delete 1. strFile1 = "D:\APLIKASI SIL\Data Teks\LandUnit.txt" 2. strFile2 = "D:\APLIKASI SIL\Data Teks\Kabupaten.txt" 3. Dim pFeatWorkspace As IFeatureWorkspace Set pFeatWorkspace = pWorkspaceFact.OpenFromFile("D:\APLIKASI SIL\Shp", 0) Dim pFeatClass As IFeatureClass Set pFeatClass = pFeatWorkspace.OpenFeatureClass("Batas-Kab-Bna-ABesar") error comes (Path/file access error) What I want is after use your given code, the pathnames above doesn't need anymore. How to do that? Thanks
... View more
01-07-2011
04:13 AM
|
0
|
0
|
573
|
POST
|
i have paste the code in userform initialize, but the code is error. one of them Len is unknown. what should i do? thanks
... View more
01-05-2011
06:55 AM
|
0
|
0
|
573
|
POST
|
Dear All vba programmer I have data (.shp, .txt) dan mxd file that store in directory D, I want my application can be run in every directory without changing data address in code. Below is my code without using path Private Sub UserForm_Initialize() Dim strFile1 As String strFile1 = "D:\APLIKASI SIL\Data Teks\LandUnit.txt" Dim strLandUnit As String Open strFile1 For Input As #1 Do Until EOF(1) Input #1, strLandUnit cboSatuanLahan.AddItem strLandUnit Loop Close #1 Dim strFile2 As String strFile2 = "D:\APLIKASI SIL\Data Teks\Kabupaten.txt" Dim strKabupaten As String Open strFile2 For Input As #2 Do Until EOF(2) Input #2, strKabupaten cboKabupaten.AddItem strKabupaten Loop Close #2 End Sub I have tried this way to change: strFile1 = "D:\APLIKASI SIL\Data Teks\LandUnit.txt" to strFile1 = App.Path & "\APLIKASI SIL\Data Teks\LandUnit.txt" and strFile2 = "D:\APLIKASI SIL\Data Teks\Kabupaten.txt" to strFile2 = App.Path & "\APLIKASI SIL\Data Teks\Kabupaten.txt" But .Path is unknown in vba I doo need someone help to solve this problem. Thanks a lot Yosie
... View more
01-04-2011
05:43 PM
|
0
|
4
|
5483
|
POST
|
I use userform to choose field value, I want the layer�??s name is the same as the selected list in the combo box. I get error at strLayer = pFeature.Value(pFeature.fields.FindField("Tanah")) and the code is: Private Sub cmdRename_Click() Dim pMxDoc As IMxDocument Set pMxDoc = ThisDocument Dim pMap As IMap Set pMap = pMxDoc.FocusMap Dim pLayer As IFeatureLayer Dim pFeature As IFeature Dim strLayer As String Set strLayer = pFeature.Value(pFeature.fields.FindField("Tanah")) pLayer.Name = pFeature.Value(strLayer) pMxDoc.UpdateContent End Sub What should I do now to make this code run well? Thanks Steve
... View more
11-20-2010
02:11 AM
|
0
|
0
|
405
|
POST
|
Hi, Could anyone share vba code or example to rename the layer's name base on one of record's value? Thank you for anyone who help regards' Yosie
... View more
11-12-2010
07:22 PM
|
0
|
4
|
1317
|
POST
|
I???m writing code with vba to build tool layer order (move layer up and down), switch from data view to layout view conversely, and turn on and off layer. I have 2 layers named river and lake. What I want is in data view: the position of layer (0) is river and lake is invisible. And in layout view: the position of layer (0) is lake and river is invisible. The result is layer only move one time every after opening file mxd, whatever the selected layer is, the 2nd run and so on only switching and turning on or off layer. And surprisingly, although the layer lake is invisible but I can see in layout view. Below are my code and no error. Could anyone please tell me where the mistake is? Thanks Yosie Private Sub MoveLayerDown_Click() Dim pDoc As IMxDocument Set pDoc = ThisDocument Dim pSelLayer As ILayer Set pSelLayer = pDoc.SelectedLayer Dim pMap As IMap Set pMap = pDoc.FocusMap Dim i As Long Dim layerIndex As Long For i = 0 To pMap.LayerCount - 1 If pMap.Layer(i).Name = pSelLayer.Name Then layerIndex = i End If Next i pMap.MoveLayer pSelLayer, layerIndex + 1 Call View Call OnOff End Sub Private Sub MoveLayerUp_Click() Dim pDoc As IMxDocument Set pDoc = ThisDocument Dim pSelLayer As ILayer Set pSelLayer = pDoc.SelectedLayer Dim pMap As IMap Set pMap = pDoc.FocusMap Dim i As Long Dim layerIndex As Long For i = 0 To pMap.LayerCount - 1 If pMap.Layer(i).Name = pSelLayer.Name Then layerIndex = i End If Next i pMap.MoveLayer pSelLayer, layerIndex - 1 Call View Call OnOff End Sub Private Sub View() Dim pDoc As IMxDocument Set pDoc = ThisDocument Dim pMap As IMap Set pMap = pDoc.FocusMap Dim pLayer As ILayer If pMap.Layer(0).Name = "Soil" Then Set pDoc.activeView = pDoc.FocusMap Else Set pDoc.activeView = pDoc.pageLayout End If End Sub Private Sub OnOff() Dim pDoc As IMxDocument Set pDoc = ThisDocument Dim pMap As IMap Set pMap = pDoc.FocusMap pMap.Layer(0).Visible = True pMap.Layer(1).Visible = False End Sub
... View more
10-16-2010
02:46 AM
|
0
|
0
|
1689
|
POST
|
Hi, I'm writing code to create layout with vba, what I want to show are map title (done), scale bar and text (done), north arrow (done), text (taken from one of field value-->not done) and only legend of the active view map (not done). - 1 have one polygon layer, shown by unique values,then I search one of them and zoom in. then I create layout to show all of the items above including the legend, but I want the list symbol of legend only show the color of active view map, not all of the symbol from the layer's unique values. - Then, I also want to show detail of the data that has been written in 1 field for each rows, so the key is base on what I choose to search. Those are really confusing, I do need help to do that. I thank you so much for everyone who help me. Thanks Yossie
... View more
05-17-2010
12:37 AM
|
0
|
0
|
2031
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|