(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
2answers
269 views

How to define Subroutines and functions?

I am working in VBA. My error is sub and function are not defined. Here is my code: Private Sub CreateMap(cboDistrict As String) Dim mapDocument As New mapDocument If ...
13
votes
2answers
3k 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) ...
7
votes
5answers
12k views

Snapping points to lines in ArcGIS Desktop and automate using VBA?

I use ArcGIS Desktop and I want create a network with a point feature and a line feature. I need my point features to be on the line features so I should do Snap point to line. However, I do not ...
0
votes
1answer
79 views

Finding points in extent using VBA

Is there a way to select a point from my map's current extent? I want to use ArcObjects to tell me if there is at least one point visible in my extent. I'd like to do this entirely in VBA, and without ...
4
votes
1answer
270 views

Debugging Visual Basic Code Block in calculate field using ArcGIS Desktop?

From time to time, I have to use Visual Basic in Calculate Field. As the code get bigger, the more complicated is to debug it. And ArcGIS (9.3) does not help as the error messages are, in the best ...
6
votes
2answers
469 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 ...
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 ...
4
votes
3answers
153 views

How do you navigate the ArcObjects OMDS?

How does everyone get round navigating the different OMD's I can work with single interfaces no problem, but when i have to use multiple interfaces I struggle to get my head round go through different ...
3
votes
1answer
499 views

ArcObjects VBA: Setting Spatial Reference for Geometry Bag

Greetings, 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 ...
3
votes
2answers
293 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
2answers
809 views

Add-in; Failure to get code to execute when toolbar button pressed

I had written several VBA routines for ArcGIS up through v9.3 and have since upgraded to 10. Since VBA will be a thing of the past in the next version, I downloaded and installed VB Express 2008 and ...
2
votes
3answers
625 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 ...
2
votes
1answer
2k views

Call tools from ArcToolBox in VBA form

I am now looking for a code in VBA that can call Tools from ArcToolBox(The little red box) I have find a Arcobject code(I thought it's can run under VBA) but it's don't work! I have to delete the ...
2
votes
1answer
1k views

Run Model ArcMap 9.3.1

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 ...
1
vote
1answer
466 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 ...
1
vote
1answer
754 views

I want create a crystal report in gis with writing code

I am working in ArcGIS 9.3.1 and I try to write code for creating a crystal report and work with it in VBA, but I recieved an error when the program arrived at this line of code: Dim pProj As ...
0
votes
0answers
152 views

How to make sure OnSketchFinished always works?

In my VBA application i have a listener setup that listens for OnSketchFinished, when the polygon is created a messagebox appears and then a userform. My problem is that the listener will work 90% of ...