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

learn more… | top users | synonyms

0
votes
1answer
616 views

Editing attribute table with VBA? [closed]

I am a newcomer to coding. My task is to create a code snippet that enables the user to edit values (rows) in the attribute table. My attribute table consists of points with basic information such ...
2
votes
1answer
187 views

Cannot Set TOC View/Tab to Display with VBA?

I have some code from 9.3 that would check the CurrentContentsView.ContextItem to ensure that the TOC was in Display (or Drawing Order) view. If not it would set it to Display via: If Not pDoc....
2
votes
3answers
833 views

How do I zoom to the overall extent of two (or more) selected features from two layers?

I am creating an application where the user picks a value from a combo box, the application then selects that feature and then selects the corresponding features from a second layer, (both selections ...
1
vote
0answers
561 views

Error creating IPoint (ArcGIS 10) - Invalid use of New keyword (VBA)

I have some code I wrote in 9.3 that (mostly) works in version 10. I have a UIToolControl that buffers a user-input point based on a mouse click - nearly identical to the sample. This used to work ...
1
vote
1answer
2k views

How to get the “queried” value from attribute table and put it in a textbox?

I am new in VBA, I have a problem about querying an attribute table....: I have a table of a layer (wish.shp) with the fields: owner_ID, Value, Area. I made 3 textboxes in a userform, I input the ...
0
votes
1answer
364 views

Cannot run toolbox model from button

I have a button on my toolbar that when clicked, will run a particular model, I have copied the code from here http://resources.esri.com/help/9.3/ArcGISEngine/com_cpp/samples/com/Geoprocessing/...
5
votes
2answers
522 views

Why esriSpatialRelTouches relation does not work?

I have two feature layers. The first one is just a polygon and the other one consists of a series of polygons which are enclosed by the first one. Thus, some polygons of the second feature layer touch ...
4
votes
1answer
589 views

Can you edit an SDE table via ArcObjects when not added to ArcMap

I have a table that is in SDE, what I want to do is in my userform click on the "Save" button, and the table will be edited even though it is not within the map document. Is this possible? I have ...
2
votes
0answers
102 views

How to solve a filename conflict problem?

I use a procedure to remove and delete a feature layer with a certain name. Then, using another procedure which is called during the run time of the program (as the remove and delete procedure as well)...
0
votes
4answers
399 views

How to solve a run-time error in Thiessen polygons command line

Well I revise my post by giving more information for my problem hoping I may get some help please. I call Procedure 2 from a loop that is within Procedure 1 (see below). The program stacks in the ...
0
votes
0answers
730 views

How to solve a Run-time error 91?

I have a function which a part shown below. The problem is that I get a Run-time error 91 (object variable or with variable not set) and the debug highlights the last line of the code ( Set ...
0
votes
0answers
187 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% ...
0
votes
1answer
409 views

Seeking guidance for ArcGIS customization with VBA

I am looking for guidance, suggestions, tips, or insights in performing a sequence of operations using VB macros for ArcGIS. A) Creating a new table How to write a macro in VB that creates a new ...
0
votes
1answer
299 views

Modifying “value” field of raster attribute table using ArcObjects? [closed]

Can I modify the values of the "Value" field of a raster attribute table using ArcObjects, and if yes how?
1
vote
2answers
726 views

ArcMap 10 How to create a tool to use with a Vb.Net script?

I have a VB.net scrip that I would like to run from the toolbar. In VBA, you would create a buttton that would collect the xy coordinates and pass the variables to the script for running. I can't ...
1
vote
0answers
226 views

How can I denote the values of reclassification using variables?

I used the following lines of code to classify a raster. However, my problem is how can I denote the old and new classification values in the last code line using variables? Then number of values ...
2
votes
3answers
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 ...
1
vote
0answers
323 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 ...
3
votes
1answer
522 views

How can I get the coordinates of a grid cell?

How can I get the real coordinates (i.e. X and Y) of a given grid cell when I know its row and column position? Thanks Demetris
2
votes
0answers
110 views

How can I identify the pixel with the maximum value in a grid? [duplicate]

Possible Duplicate: How to find the locations of the highest values in a raster? How can I identify the pixel with the maximum value in a grid and get its coordinates? Any VBA code please?
15
votes
5answers
5k views

How can I find the farthest point from a set of existing points?

I have a set of points as a shapefile and I want to find (the coordinates) of a new point which will have the longest possible distance from each of the existing points. Is that possible? If yes, is ...
14
votes
2answers
4k views

How can I create weighted Thiessen polygons?

I have a point shape file and I create Thiessen (Voronoi) polygons programmatically using this scripting syntax: CreateThiessenPolygons_analysis (in_features, out_feature_class, fields_to_copy) ...
6
votes
2answers
588 views

How can I add a new field in a raster attribute table and loop through it?

I am working with an existing raster attribute table. I wonder how can I add a new field to it and then loop through the existing records to populate this new field? Of course I have done this many ...
3
votes
3answers
8k views

Polyline length calculation in ArcGIS 10/VB script

I used to run this length calc on my data in ArcGIS 8 and 9, and now it don't work in ArcGIS10. Can you tell me what I have done wrong? Dim dbllength as double Dim pcurve as icurve Set Pcurve = [...
0
votes
1answer
640 views

Going round in Circles..Buffering/ArcObjects/VBA

I've just started learning VBA and Arcobjects, and at the moment just playing around tyring to do different things. What i am trying to do is Click on a tool, and allow the user to put a point ...
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 ...
4
votes
1answer
905 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 ...
2
votes
1answer
473 views

How to use nested loops with cursors?

I use the following nested loops to read the first point feature of a dataset and the rest points in that dataset. Then read the second point feature of a dataset and the rest points in that dataset ...
3
votes
2answers
916 views

How to loop through an array of point features?

I have a set of point features and I wish to find the points that have common coordinates. Now I changed the code as shwon bewlo by using the IPoint and the compare method through a function. I have 2 ...
1
vote
2answers
254 views

How can I define the extent setting of environments programmatically in VBA?

I use the following line of code to define the extent setting of the environments GP.Extent = "144566.589424822 351191.130242809 145772.160224822 353810.742942809". However, I need to define it ...
3
votes
3answers
1k views

VB/Python script to populate a field with maximum value among other fields

I am using ArcGIS 10. I have a little experience with python but i feel that python in ArcGIS is slightly different. VB will work fine as well. Problem: I have n different columns called 'percent_1', ...
6
votes
1answer
11k views

Install VBA on ArcGIS 10

What is the complete recipe for installing VBA for ArcGIS 10 Desktop? The Esri help topic on this is incomplete. From the number of threads I found troubleshooting this I'm not the only one ...
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
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 ...
1
vote
1answer
2k views

Creating Thiessen Polygons (Analysis) by defining external feature boundary?

Although this issue has been addressed in this post some months ago: Thiessen Polygon delineation within a Feature, the appropriate answer has not been given. So, new ideas are welcome. My question ...
3
votes
2answers
13k views

How to call a DLL file from VBA?

I have a DLL file that I have loaded and registered it in ArcGIS as a command icon. This icon launches a window where the user should do the following selections: an input file, a field name, select ...
1
vote
2answers
806 views

intersection between a geometry and a layer in Arcobjects VBA

i have to make an intersection between a polygon and a layer of parcels, the polygon used in the clip is not belonging to any layer and the result of this intersection should be all the parcels inside ...
2
votes
2answers
1k views

Copying Symbology between layers with different numbers of features

I am working on copying a layers symbology to a number of other layers which have the same geometry, table structure etc, etc but not the same number of features. I have a state wide layer and I ...
6
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 ...
2
votes
1answer
550 views

Adding ILayer to IMap in ArcGIS Server?

I wanted to add ILayer to IMap, i think it has been added but problem is that it does not display it on the website. I am running ArcGIS Server 10, using visual web developer 2010 express edition ...
1
vote
0answers
218 views

vba code for algorithm to assign track file gps UTM coordinates (East Africa) to an overlay 5x5km grid cell

The GPS coordinates are temporarily imported in to an Access database from DNR Garmin files downloaded (as dbf file(s)), and then exported for mapping in AEJEE (ArcExplorer Education Edition). I need ...
4
votes
3answers
1k views

Add button to open URL in ArcMap 10

I want to be able to add a button into ArcGIS for my users, something like this: http://gis.utah.gov/code-visual-basic/vba-link-from-arcmap-to-google-maps Only, using VBA in ArcMap 10 now seems to ...
3
votes
1answer
1k views

How can I execute my custom model's tools in VB.Net?

I want to execute one of my tools (which I created with Model Builder). I can execute a built-in tool by this code, but when I change the tool name with Model Tool Names it doesn't work. I gathered ...
3
votes
2answers
665 views

Count the number of segments of a polygon based on the angles

I wish to count the number of segments of a polygon that has a length less than 25 meters when the angle between two vertices is not close to 180 degrees i.e. if the angle is between 178 to 182 ...
1
vote
1answer
1k views

Convert old ArcGIS 9 VBA tool to new Python script tool for ArcGIS 10

I have an ArcGIS .mxd file with an imbedded VBA script that is executed from a tool bar button. I would like to convert this VBA script tool to a python script tool for use in ArcGIS 10. Is that ...
2
votes
2answers
601 views

Create a dbf table by copying the structure of another dbf table

I have a dbf table and I wish to automatically create another dbf table with a different name but with exactly the same structure i.e.fields as the existing table. Is there any ready code in VBA and ...
1
vote
3answers
3k views

Calculate XY Coordinate with “CalculateField” tool

I used model builder to build a model which can calculate the XY coordinates and it's perfect! However, when I export it to VBscript and run it in VBA it crashes.... The error happens at gp....
2
votes
2answers
834 views

How to creat a graph from a Field values (VBA_ArcObjects)

I have a combobox that shows all fields of a shapefile. I want to get these values programmatically in a label--Count, Minimum, Maximum, Sum, Mean, Standard Deviation--and populate a graph of the ...
2
votes
2answers
837 views

Topological relationship between two polygon feature layers in VBA and ArcObjects? [closed]

I have two polygon feature layers: one representing land parcels and one representing roads. Some land parcels (polygons) coincide with a part of a road (another polygon feature). How can I check ...
1
vote
1answer
553 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 ...