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

learn more… | top users | synonyms

3
votes
1answer
388 views

Need help translating small code block from VBA to Python

I need help from someone to translate a small piece of code from VBA to Python, due to the fact that the company I am working for has upgraded from ArcGIS 9.3.1 to 10.0 and VBA is no longer supported. ...
1
vote
1answer
160 views

How do i get ArcObjects not to ignore a layer definition that has been set?

I am creating a simple text search application, where the user can enter an address search and the result appear in a listbox, which they can then select it and zoom to the address. Now the problem I ...
1
vote
1answer
522 views

How do I delete specific graphics on the map using arcobjects

I am writing a small application that allows the user to click on the map, and it will create 3 buffers (these are graphics using the IElement interface) at specified distances. What I want to do is ...
2
votes
3answers
2k views

Find polygon centroid with Python

I'm using ArcGIS 9.3 to find centroid of some polygon features. I'd like to do this in Python, but so far I can only find solutions with VBA. Can anyone provide some leads here?
1
vote
1answer
75 views

generating some random points along network

I'm having trouble with generating some random points along a network. I am trying to do it with Arcobjects in the VBA environment. I would be grateful if you could help me.
2
votes
2answers
1k views

How to overwrite a shapefile or feature class using arcobjects?

I can copy a shapefile but I want to be able to overwrite the copied shapefile to prevent multiple copies being created each time I run the program. I would also like for the saving and renaming of ...
3
votes
2answers
534 views

Adding VBA into a Python script generated by ModelBuilder

I have created a model that does a calculate field and have used VBA in the code block. But when I export it to Python, it doesn't work. Here is the VBA code: new_value = ...
1
vote
1answer
279 views

Search By Location

Using Arcmap 9.3 I was curious if anybody has a script or vba tool that will select items from a layer that are not within a selected polygon or not touching the selected polygon. Thanks for your ...
1
vote
0answers
47 views

VBA to ActiveX tool

I have several scripts that I create UIcontronButton from, but I really want to create a dll from the scripts so I dont have to copy paste scripts on every computer. How do I create arcmap tool dll?
1
vote
1answer
345 views

Run a ArcMap (10.0) Addin Button with VBA from a MS-Access form

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 the "pItem.Execute" method with ...
0
votes
0answers
106 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 I GDispatch failed". The line that the code stacks is the last one ...
0
votes
1answer
188 views

Creating a report from features that have been selected

I'm in need of some guidance, I have created an application where the users does the following workflow Enter Postcode Zoom to Postcode Create a buffer at specified distance Spatial Query to find ...
0
votes
1answer
373 views

Focus ArcMap application Window VBA

Very simple question to ask, I haven't been able to figure it out up to now though... How would you focus your ArcMAP application window using VBA? I have a script that runs and selects polygons and ...
1
vote
1answer
289 views

Trouble trying to zoom to graphic (ArcGIS 9.3.1, VBA)

I am writing an application where one of the things it does is create a point then creates buffer (which is a graphic) at the specific point, what I want to do is when the buffer has been created, is ...
3
votes
2answers
449 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 ...
0
votes
1answer
451 views

ArcGIS 9.3.1 VBA: Unable to loop through datasets using 'ILayerGeneralProperties' when raster catalog is present

I have a simple project which involves the use of several buttons in order to make various datasets visible depending on which category is required at the time. It works fine using the popular ...
2
votes
1answer
2k views

Creating a featureclass in memory and adding to the map error

I have the code below, which is supposed to create a new featureclass in memory then add the FC to the map, but I get a Automation error when I use the createfeatureclass method Set pFC = ...
1
vote
0answers
174 views

Relative paths in ArcScene document are broken if opened programmatically

When I open ArcScene document with relative paths programmatically from ArcMap, all those paths are broken. The location in source tab for broken layers is set to some different path like ...
2
votes
1answer
186 views

How to use ITransform2D on dimension features (arcobjects)

I am trying to move a dimension feature inside a personal geodatabase using ArcObjects VBA. I was able to move other types of features using similar code as shown below. However it is not working for ...
0
votes
0answers
347 views

Open the IGxDialog in MS Access 2010 using VBA

I hope this is the right forum for this question. I have a program in MS Access that allows users to input varius aspects related to land treatments including the spatial information (point, line, or ...
0
votes
1answer
399 views

How to edit my attribute table with VBA

before I start you should know that I am a bloody newcomer when it comes down to coding. I am sitting on some university tasks regarding VBA and ArcGIS: My next task is to create a code snippet that ...
2
votes
1answer
157 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 ...
2
votes
3answers
529 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
369 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
1k 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
294 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 ...
5
votes
2answers
304 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
446 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 ...
0
votes
0answers
432 views

Problem with calendar object in VBA (ArcGIS 9.3.1, Windows 7)

I have an application (that wasnt created by me), which was created on Win Xp, the user it was created for now has Windows 7. The userform has a calendar control, but when they try and run the ...
2
votes
0answers
95 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 ...
0
votes
4answers
307 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
353 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
124 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 ...
0
votes
1answer
376 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 ...
1
vote
1answer
194 views

Can I modify the “value” field of a raster attribute table?

Can I modify the values of the "Value" field of a raster attribute table and if yes how? Thanks Demetris
1
vote
2answers
386 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
150 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
2answers
954 views

Collapse layers in ArcMap Table of Contents using ArcObjects

Can someone offer up a Christmas present here? 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 ...
1
vote
0answers
227 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
375 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
104 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?
13
votes
5answers
2k 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 ...
13
votes
2answers
2k 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
433 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
3k 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
472 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 ...
2
votes
1answer
2k views

How to count and record the number of entities with the same name in the field calculator?

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
582 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
329 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
604 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 ...