(Visual Basic for Applications) A subset of Visual Basic that provides a common language for customizing Microsoft applications.

learn more… | top users | synonyms

1
vote
0answers
315 views

Extract by mask run time error in VBA

I have the following script language code shown below within a main code just to run the tool of spatial analyst "Extract by mask". Unfortunately, when I run it I get a Run Time Error. I checked file ...
0
votes
0answers
176 views

How to make sure OnSketchFinished always works?

In my VBA application I have a listener set up that listens for OnSketchFinished, when the polygon is created a message box appears and then a userform. My problem is that the listener will work 90% ...
2
votes
1answer
47 views

x, y to decimal degrees on mouse click in ArcObjects?

I am converting an old VBA code I used to use in ArcMap 9.2, into VB.NET for ArcMap 10. It should extract x, y coordinates from OSGB and converts to decimal degrees while copying to clipboard. I ...
3
votes
2answers
636 views

Zoom to Polygon in Arcmap from Access

I am attempting to Zoom from an Access record to a specific polygon in ArcMAP but I can't seem to get the function to work. The field in Access is identical to the field in arcmap. I.E. they both ...
3
votes
2answers
6k views

Updating selected feature/record using ArcObjects (VBA)?

I would like to edit a selected feature/record via ArcMap vba, but I'm not having much luck with this code sample (see code below). I'm not getting an error, but the record selected is not updating. ...
1
vote
1answer
1k views

Creating perpendicular polylines of specified length that retain attributes of original polylines using ArcObjects and VBA?

I am using ArcGIS 9.2 and am desperately trying to create perpendicular polylines to existing polylines that I have. I would want the perpendicular lines to cross the original lines at their midpoint ...
4
votes
1answer
881 views

Visual Basic editor command icon is always disabled

I recently installed ArcGIS 9.3 in a PC with Windows 7.0. I opened an existing mxd file within which I developed some toolbars for a project. Each icon of a toolbar has behind it a VBA and ArcObjects ...
4
votes
1answer
2k views

Running VB scripts in ArcGIS Desktop?

Some questions about VB scripts: Can I read and modify the code of a VB script? If the answer is yes, how can I do it? How can I run a VB script? Can I use it as a VBA code eg.using variables ...
5
votes
1answer
4k views

Recording frequency of names in the attribute table?

I have a question with ArcGIS 9.2. In an attribute table the column [name] includes the name of every place in this layer. Next to that (in columns [numbers]) there should be recorded how often a ...
1
vote
2answers
66 views

“CountIf” or alternative function in ArcMap field calculator?

Within ArcMap 10.3 field calculator, I am looking to count the number of features in a column that match the current value, and output that count. Ideally, the output would look like this: Number ...
5
votes
2answers
5k views

VBA code to edit and add azimuth values to attribute table

I have a point shapefile. I made a button that finds the best fit line for selected points and calculates the azimuth of it (zero degrees being the east). Is there a way I can add something to the ...
2
votes
2answers
2k views

Collapsing layers in ArcMap Table of Contents using ArcObjects?

I'm stuck on how to collapse all layers in my ArcMap projects (9.3). I've tried a few bits of sample code, but they all seem to fail for some reason or other. Some of the layers might be grouped, and ...
4
votes
1answer
1k views

Creating adjacency matrix of topology graph of ArcMap for shortest path using ArcObjects? [closed]

I have created a topology graph of a polygon feature and I want to find the individual FIDS of the lines of the polygon. I want to construct an adjacency matrix to create the shortest path. How can I ...
1
vote
0answers
52 views

How to rearrange FID numeration programmatically

I've got a feature class Now, I delete the selected features programmatically using pFeature.Delete : Is there any command or function in VBA which rearranges the FID field and makes the ...
1
vote
1answer
41 views

Can't fill the attribute table programmatically

I've got a shp-file, here is it's attribute table: It's easy to fill the attribute table of some pFeature programmatically if I get the feature from cursor: For example, "RECNO" Field(3) has a ...
0
votes
2answers
135 views

Merging features into single programmatically

I have a shapefile with polygons. I can merge them manually by going into edit session and, selecting a some features to be merged, and then using merge button under Editor. How to do this ...
1
vote
2answers
160 views

How to get a Layer as ILayer (ArcObjects)

I had asked this question previously which I think will work. But as I am new to this, I can't figure out how to get a Layer as an ILayer object to pass to the method that's in my previous questions ...
5
votes
1answer
5k views

Using VBA in ArcMap field calculator?

I am trying to use ArcMap's Field Calculator to populate values in a column based on a value in another column. So, in pseudo-code: if [field1] = 'Foo' set [field2] = 'Bar' endif Something like ...
2
votes
3answers
659 views

Verifying that ArcInfo Workstation is Installed?

What is the best way to verify that a machine has ArcInfo Workstation installed? A code sample in VBA, VB or C# would be great!
0
votes
2answers
53 views

Any extention Open File Dialog

GetOpenFilename doesn't work in arcobjects VBA, so I have to use pGxDialog. Standard pGxDialog doesn't let to open any file I want, a few extentions are available only (shp, dxf, xls...). Maybe, I ...
1
vote
2answers
39 views

How to get the geometry type FIELD value of attribute table?

The problem is: I need to copy every cell's value of attribute table of some feature to string array. I do it by assigning cell's value to string variable StrBuf one by one. To check the result the ...
1
vote
2answers
33 views

How to get the Features of FeatureCursor?

I am unsure how to correctly use IFeatureCursor.NextFeature method. I've selected a few features: I need to assigne the selected features into few pFeature variables (pFeature1, pFeature2, ...
1
vote
1answer
526 views

Running ArcMap Addin Button with VBA from MS Access form?

I am using ArcGIS Desktop 10.0. I need a way to execute an ArcGis-Addin (vb.net) from a MS-Access database form (VBA). The problem is that there is no ESRI.ArcGIS.Desktop.Addin reference in VBA and ...
2
votes
2answers
434 views

Converting personal geodatabase feature class to coverage using ArcObjects? [closed]

how to convert personal geodatabase fatureclass to coverage using arcobjects with vba pls provide me any documentation or samples.
-4
votes
1answer
423 views

Creating multipart polygon using ArcObjects if coordinates of each part are given? [closed]

How to create a multipart polygon if i am having the values of coordinates of each part. I am using ArcObjects in VBA or VB.NET
0
votes
1answer
26 views

Setting color to line layer using VBA in ArcGIS Desktop?

I am getting the compile error at pcolor.RGB. I want to add a color to the line feature. How to modify the code? Public Sub surya() Dim pmxdoc As IMxDocument Dim pstylegallery As IStyleGallery ...
2
votes
2answers
434 views

Route hatch labeling as stations (0+00) with vba

I have a route feature which I have set up to label every 500' with the distance along the line. I'd like to use typical stationing format (000+00). I've been using the following VBA script: Function ...
0
votes
0answers
138 views

Run time error for GP objects

I have a code with toolbars, which I tried to run it in another PC, but it failed. I get a run time error "Method Addtoolbox of object IGDispatch failed". The line that the code stacks is the last one ...
3
votes
1answer
72 views

How to sort attribute table using ArcObjects/VBA code?

I'm using ArcMap 9.3. Shift the rows order display (ascending/descending) for a given field is as simple as double clicking on the screen. However I'd like to know how to perform this simple ...
0
votes
0answers
96 views

Drawing polylines with angle and distance using vba

I am new to arcobjects using VBA. I have a point feature, and i want to draw polyline using point feature as starting point in desired direction and distance. And I have to draw second line basing the ...
0
votes
1answer
76 views

Vba Cons Numbers [duplicate]

I want to make a list of cons numbers(ex. 1,2,3...) in field calculator (VBA). When I am putting for example: (dim d d=[field]+1). The result is all my fields are =1. How to solve this arc map (vba).
1
vote
2answers
59 views

Matching OBJECTID with a value at VBA in Arcmap

I got a building layer. And i got a table that contains 2 fields named SDE_OBJECT_ID and DOOR_NO. This table is not spatial table, it's Oracle table which i can join with my building layer if i want ...
2
votes
1answer
126 views

Calculating Sinuosity Using ArcGIS Field Calculator

Trying to calculate sinuosity via Field Calculator (ArcGIS v 10.2.2); VBA Pre-Logic Script Code: Dim dblLe as double Dim dblLf as double Dim dblS as double Dim pCurve as Icurve Dim pFPoint as IPoint ...
4
votes
2answers
1k views

MS Access and geocoding in ArcGIS

We are a small non-profit. We use a fairly complex MS Access application to track everything. We would very much like to geocode addresses in our application and display the results on a map. In ...
1
vote
1answer
139 views

Transitioning VBA Code to ArcGIS 10.2

I am moving some applications written in VBA that have been working in ArcGIS 10.1 to ArcGIS 10.2.2. I have the ArcGIS VBA Compatibility patch installed, in addition I have gotten several ...
2
votes
1answer
236 views

Syntax for ArcGIS ICalculator object?

I have a code snippet that I can't figure out: 'Define a calculator for NewArea field pCalculator = New Calculator With pCalculator .Cursor = pCursor .PreExpression = "Dim ...
0
votes
1answer
93 views

Referencing a method from a different class within an Else statement and using 2 variables with the method

I am transferring a code from a VBA module to a C# arcmap add-in. I am using ArcMap 10.2 and Visual Studio 2010. I cannot figure out how to translate what appears to be a method from a different ...
3
votes
3answers
2k views

get layer names from a group within a group

Trying to get the layer names from a group that are inside a group. I have the code the gets the layer from a group, but not group inside group. any ideas? Dim pDoc As IMxDocument Set pDoc = ...
0
votes
1answer
107 views

Arcmap 10 Visual Basic

im wondering if there is a way to build something like this in Arcmap 10 since VBA isnt supported anymore. Its for my Thesis. I need a tool to handle Polygons and their Information like in the ...
0
votes
0answers
126 views

Replacing text in AutocadMAP File using excel data

I have an autocad drawing with so many light fixtures with all different names.Now we have to change all those names, i already have an excel sheet containing two columns with first one containing ...
1
vote
0answers
49 views

VBA not able to fill all FNODE and TNODE because of large number (1,200,000) of records? [closed]

I need to populate FNODE and TNODE fields for my roads dataset. I have an intersections point feature class that has unique ids, and I need each road segment to have an FNODE and TNODE value that ...
1
vote
2answers
3k views

Excel Macro to KML using VBA Loop

I am trying to write a VBA loop which will turn a list of addresses and their corresponding Lat Long coordinates in to a KML file for viewing in Google Earth. I have managed to get the opening and ...
1
vote
1answer
533 views

Using kriging with data in GDB

I have series of data in my GDB I am running the program under VBA and what I want to do is using the data by the tool Kriging. This is what I thought: First, Kriging needs data that must be a ...
-2
votes
1answer
619 views

Adding VBA code to ArcMap

I have a VBA code and I need to add it to ARCMap 10.2.2 but not sure how to do it I couldn't find anything online.
0
votes
0answers
65 views

select by location in vba

I got two Layers (Point and polygons) in my Application and want to write a vb macro, where point layer is cities layer and polygon layer is state's layer, I want to know that how many cities are ...
2
votes
1answer
1k views

Running Model within ArcMap using VBA?

I would like to Run/execute a model within ArcMap 9.3.1 vba. I can run it in vba by exporting out the VBS script and importing it into vba, however I'm wondering if there is an easier way to just call ...
0
votes
0answers
54 views

How to fill combobox with attrbute data

I am coding using vba in the visual basic editor given ny arcgis9.3, I have u user form,in user form there is a combobox and a commandbutton. I have also added four shape files.so i want to fill the ...
3
votes
2answers
318 views

Getting line FID from polygon ITopologyGraph

I want to export polygon Arc list to txt file for that I created topologygraph for personal geodatabase feature class (polygon) using ITopologyGraph::build. I got polygon FIDs but I am not getting ...
3
votes
1answer
570 views

Setting Spatial Reference for Geometry Bag using ArcObjects and VBA?

Within the ESRI SDK resources there is an example of combining polygons by use of a geometry bag. The following code appears: 'Define the spatial reference of the bag before adding geometries to ...
5
votes
1answer
2k views

How to save a layer file with a relative path

In VBA, how do you save a layer file (.lyr) with a relative path? I have some code that loads a shapefile into ArcMap but I am unsure of how I go about using this shapefile to then save a layer file ...