You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - ArcObjects General forum

Calculate causes VBA error in 9, but not in...   Heather Terrapon Sep 30, 2003
Re: Calculate causes VBA error in 9, but no...   Gary MacDougall Oct 01, 2003
Re: Calculate causes VBA error in 9, but no...   Robyn Gallagher Nov 16, 2003
Re: Calculate causes VBA error in 9, but no...   Robyn Gallagher Nov 18, 2003
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Calculate causes VBA error in 9, but not in 8.3 
Author Heather Terrapon 
Date Sep 30, 2003 
Message Hi

When doing the following calculation in ArcMap 9, we recieve an error, however the same calculation in ArcMap 8.3 works.

Calculation:
Calculate the value of a text field: "Test" + Format ( [FID] + 1 )

Error:

Pops up a box titled ArcMap with message:
Error Running VBA code : User Interrupt.

If you click OK it pops up a box titled Field Calculator with message:
Type Mismatch: 'Format'

Do you have any ideas what might be causing this?
Regards,
Heather 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Calculate causes VBA error in 9, but not in 8.3 
Author Gary MacDougall 
Date Oct 01, 2003 
Message Heather

I'll add a bug for this - it should work. As a work around, try the following:

"test" & ([OBJECTID] + 1)

Gary 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Calculate causes VBA error in 9, but not in 8.3 
Author Robyn Gallagher 
Date Nov 16, 2003 
Message We also see a VBA error in an Advanced Calculate (calculating area in hectares for data in decimal degrees) that works in 8.2

Data Frame is Albers, Code is

dim pMxDoc as imxdocument
set pmxdoc = thisdocument

dim pGeom as igeometry
set pGeom = [Shape]

pgeom.project pmxdoc.focusmap.spatialreference

dim pArea as iarea
set parea = pgeom

dim dblArea as double

' dblArea = parea.area
dblArea = parea.area/10000.0

Field=
dblArea 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Calculate causes VBA error in 9, but not in 8.3 
Author Robyn Gallagher 
Date Nov 18, 2003 
Message Further to my last message.

We have discovered that the Advanced Calculate only gives a VBA error if we run the pc standalone. (The data, mxd, cal file are all on its C: drive)

If we connect to our network (still using everything on C:) the Calculate works fine.

The bug was probably in 8, and we just didn't notice it.

Even working standalone as Administrator doesn't help.

Weird???