Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [vba]

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

0
votes
1answer
29 views

VBA/Python If/then statements in Field Calculator for one column based on another not working

I know this question has been asked a hundred times on here, for example: Basic If/Then in Python Parser of ArcGIS Field Calculator? Using if/elif/else statements in ArcGIS Field Calculator? Checking ...
0
votes
0answers
16 views

mapwingis.ocx with vb6 using user defined points

I'm looking for working sample code to add a user-defined bitmapped point to a map in vb6/vba. the example in 'getting started with the mapwingis control' dont seem to be up do date with the ocx, and ...
0
votes
1answer
37 views

VBA Labeling works on some symbol classes but not other

VBA Labeling formatting works on some symbol classes but not others. For some symbol classes it will work but others it won't register the formatting and I can't figure out why! CLR red = '56' ...
1
vote
0answers
57 views

Run-time error -2147467259 (80004005) in VBA when clicking and saving polygon to shapefile? [closed]

I'm fairly new to this project and to VB and got some of old code to fix. The task is to click a polygon on the screen with the mouse and then save it to a shapefile. When executing the code, it ...
0
votes
1answer
98 views

Calculating Sequential Field ID For Unique Identifier using Field Calculator

I have a feature class of 7308 features. I have given each feature a unique name (WM-0001 for example) as the FID's jump all over the place. I realized that my new ID's do not match up with the number ...
0
votes
0answers
19 views

Running MS Access VB Module from ArcCatalog?

I created some VBA code that runs a make table SQL in MS Access. Whenever the MS Access database is opened it automatically runs the SQL and updates the table. I then created a database connection to ...
1
vote
2answers
69 views

ArcPy/Python method to ascertain VBA requirements in mxd

I need to be able to look at an MXD and ascertain if it has any VBA code embedded within it. It's ArcGIS 10.2, and the VBA extension tool is installed on all machines on the estate, but not all mxd ...
1
vote
0answers
75 views

Pick point X,Y values getting from ArcMap window [closed]

How to pick a point on Arcmap window using with ArcObjects(BaseCommand)? I want to get X,Y values of a point. I have tried to pick point using with below code. but debugging time not showing arcmap ...
1
vote
1answer
150 views

MS Access/VBA used to open an ArcGIS map document: Map fails to connect to database

I have an MS Access front-end that can be used to open ArcGIS map documents (.mxds). It has a macro that runs an OpenRoadMap() function: Function OpenRoadMap() CreateObject("Shell.Application")...
1
vote
0answers
105 views

ArcObjects queries using selection set

I'm new to ArcObjects and I'm finding it difficult to work with the ArcObjects 'Feature classes'. Coming to my problem, I have a Map with few layers. I have coded for the layer names to display in the ...
2
votes
0answers
85 views

Automation Error while running Geoprocessing tool using VBA in ArcMap?

I am trying to run a geoprocessing tool in ArcGIS 10.2 as a part of a VBA GUI (kind of) that I'm trying to create - unfortunately it gives me an automation error. I'm new to VBA and ArcGIS. The ...
2
votes
3answers
205 views

“Error in Parcel Selection” in SaeX in ArcGIS 9.3

I am using SaeX extension in ArcGIS 9.3 and whenever i try to select a parcel it gives: Error occured in parcel selection. Other tools are working fine.
0
votes
1answer
55 views

Invalide charater error associated with “Select-Case” vba

Anyone see a problem with the following code. I keep getting a 999999 - invalid character error. Select Case [code] case 5112: x = "AP030" ' trunk<br /> case 5113: x = "AP030" ' ...
1
vote
1answer
569 views

Google Earth 1.0 Type Library Missing

I've been running Excel to Google Earth Dashboards for some time through VBA on Windows 7 and Excel 2010. However, I have just tried to copy one of my workbooks to a Windows 8.1 machine on Excel 2016 ...
3
votes
0answers
108 views

Exporting ActiveView to Jpeg using ArcGIS 10.2.2 fails

I have some legacy VBA code that exports the activeview to a jpeg, which needs to be updated, so it can be used in ArcGIS Desktop 10.2.2. The application uses the following code Option Explicit ...
2
votes
2answers
1k views

Convert 5 digit serial date to mm/dd/yyyy

I have imported a table from Excel that has one field (StartDate) to hold dates. When I imported the table it into ArcMap, the date values in that field changed from DD/MM/YYYY to a 5-digit number, e....
2
votes
1answer
347 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 ...
1
vote
2answers
1k 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 &...
1
vote
0answers
106 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 numeration ...
2
votes
1answer
76 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
3answers
382 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
184 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
2answers
106 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 ...
0
votes
2answers
582 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 ...
0
votes
1answer
212 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 ...
3
votes
1answer
301 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 ...
1
vote
2answers
147 views

Matching OBJECTID with value using 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
443 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 ...
2
votes
0answers
391 views

Transitioning VBA Code to ArcGIS 10.2 [closed]

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 ...
1
vote
1answer
102 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 ...
0
votes
1answer
366 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. I need a tool to handle Polygons and their Information like in the picture with a simple ...
0
votes
0answers
438 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
69 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 ...
-2
votes
1answer
4k 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.
2
votes
1answer
576 views

Tutorial on creating python toolboxes?

I've done the ESRI training: Creating Python Toolboxes Using ArcGIS 10.1 but is there anything more in depth? Since VBA is no longer supported in ArcMap 10 and up I'm trying to convert a cross section ...
1
vote
2answers
10k 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 ...
2
votes
2answers
1k 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 ...
1
vote
2answers
976 views

Cannot convert dms to dd in Excel 2007 using VBA code

I am trying to convert the data in an Excel sheet from dms (degree-minute-second) to dd (decimal degree) format using the vba script available here. Here is sample data: 53° 0' 39.31" 6° 44' 50....
11
votes
1answer
383 views

Extracting all points within a certain distance and height difference from a Raster

I have a raster containing tens of millions of points all with X, Y and Z data defined. I need to figure out a simple way to extract and create a new raster or vector with ALL points at a 720 m ...
1
vote
1answer
305 views

How to pass a variable (FilesToAdd) from VBA script (interface) to a Mapbasic program?

Option Explicit Public FilesToAdd As Integer Private Sub TEST_Click() FilesToAdd = 1 Dim b As Variant Dim Prog As String Dim File As String Prog = "C:\Program Files\Mapinfo\Professional\Mapinfow....
1
vote
0answers
31 views

Making point selection tool using ArcObjects with VBA? [duplicate]

I want to make a selection tool that I can use to select a feature point in ArcGIS for Desktop so I can combine it with a form that I just made to display the form after the feature selected. I use ...
1
vote
2answers
471 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 ...
-1
votes
1answer
108 views

Learning ArcObjects with VBA and .NET? [duplicate]

I am using arcgis from last 3 years. but it was only limited by button pressing. I want to learn ArcObjects VBA and .NET. Can you suggest me some reference books?
0
votes
1answer
907 views

Opening QGIS using VBA and executing Python script?

Using VBA, I want to open QGIS (the actual GUI) and execute a simple script through the Python console or the editor.
3
votes
1answer
710 views

How to make a Python script that does a task in QGIS?

When I run this code in QGIS Python console it works fine, but I want want to run it from an external Python script. What I want the script to do is: 1- Open QGIS 2- Run this code 3- Close QGIS from ...
0
votes
1answer
242 views

How would I create an input mask for ArcGIS Desktop?

Someone asked me if we can create a simple input mask for geodatabase feature classes so that editing of attributes becomes easier. I am however not sure how this works with ArcGIS 10.x Is this ...
2
votes
0answers
469 views

Longest route of a stream in ArcGIS? [closed]

I have a shapefile with polylines representing rivers all over a region. In the attached image, there is an example of one river. The longest route is marked by the two red dots on this river, but it ...
1
vote
1answer
305 views

Can Geomedia be automated using VBA?

Can I automate Geomedia using VBA? The Geomedia training manual "Fundamentals of Geomedia Development Part 1" talks about automating using visual basic but I do not have Visual Basic.
1
vote
0answers
425 views

How to capture GPS co-ordinates from a Microsoft InfoPath form on a mobile device

We are looking for a way to capture GPS coords through the Microsoft INFOPATH form which is loaded on our Mobile Motion device. Basically, we are trying to put a VB script behind the “Get GPS Coord” ...
1
vote
0answers
95 views

How to create a startup prompt that populates definition queries on multiple feature classes [closed]

I would like to create an ArcGIS start up prompt or custom button that asks for a user's initials and then populates multiple feature class & layer definition queries. More specifically, I would ...