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

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - Attribute Tables forum

Error running VBA code: User Interrupt / Fi...   Ashley Ignatius Aug 02, 2009
Re: Error running VBA code: User Interrupt...   Neil Clemmons Aug 03, 2009
Re: Error running VBA code: User Interrupt...   Ashley Ignatius Aug 03, 2009
Re: Error running VBA code: User Interrupt...   Neil Clemmons Aug 03, 2009
Re: Error running VBA code: User Interrupt...   Ashley Ignatius Aug 03, 2009
Re: Error running VBA code: User Interrupt...   Michael Hintze Aug 04, 2009
Re: Error running VBA code: User Interrupt...   Eric Bowman Oct 05, 2009
Re: Error running VBA code: User Interrupt...   William Edwards Aug 05, 2009
Re: Error running VBA code: User Interrupt...   Carlos Armas Feb 01, 2010
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Error running VBA code: User Interrupt / Field Calculator: Overflow 
Author Ashley Ignatius 
Date Aug 02, 2009 
Message I have an attribute table of basic census data, and I am trying to determine the percentage of persons in a block that are certain race/ethnicity, i.e. "white". I opened up the attribute table, added a field, and using the field calculator, wrote the following expression [WHITE]/[POP2000]. This expression should give me a number less than 1. Then I click OK, and I receive the following message: "Error running VBA code: User Interrupt". So, I click OK, and receive the following message "Field Calculator: Overflow". I just can't figure out what's wrong. My only guess is that perhaps it has something to do with the field type (Long)?
Thanks! 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Error running VBA code: User Interrupt / Field Calculator: Overflow 
Author Neil Clemmons 
Date Aug 03, 2009 
Message Make sure all of the values in the POP2000 field are numeric (ie, no nulls or text) and that none of the values are 0. Division by 0 will give you an error for sure. 
  Neil Clemmons
Senior GIS Developer
Geographic Information Services, Inc.
Birmingham, AL
http://www.gis-services.com

Check out our blog:
http://blog.gis-services.com/ 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Error running VBA code: User Interrupt / Field Calculator: Overflow 
Author Ashley Ignatius 
Date Aug 03, 2009 
Message Thank you! How could I not notice the zeros!
In a case of a zero, is there some sort of 'work-around' I could put into the equation...such as

NEW FIELD = [white]/[total] unless [white]=0 or [total] =0, then, NEW FIELD = 0

Ashley "determined to figure this out" Ignatius 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Error running VBA code: User Interrupt / Field Calculator: Overflow 
Author Neil Clemmons 
Date Aug 03, 2009 
Message Click the Advanced checkbox and copy/paste the code below. Make sure the field names are correct before running it. This will help prevent a division by zero error. 
 
Dim value As Double
If [POP2000] <> 0 Then
  value = [WHITE] / [POP2000]
Else
  value = 0
End If


New Field = value
 
  Neil Clemmons
Senior GIS Developer
Geographic Information Services, Inc.
Birmingham, AL
http://www.gis-services.com

Check out our blog:
http://blog.gis-services.com/ 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Error running VBA code: User Interrupt / Field Calculator: Overflow 
Author Ashley Ignatius 
Date Aug 03, 2009 
Message Thank you very much! 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Error running VBA code: User Interrupt / Field Calculator: Overflow 
Author Michael Hintze 
Date Aug 04, 2009 
Message should this code be copied and pasted exactly as is? I keep getting an "error running VBA code" message when I substitute "land_value" for "pop2000" and "improv_value" for "white" in trying to calculate improvement to land ratio.

thanks 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Error running VBA code: User Interrupt / Field Calculator: Overflow 
Author Eric Bowman 
Date Oct 05, 2009 
Message Michael,

Make sure you are using [field] with the brackets instead of " ". Also, make sure you take out the following

New field = value

That should go at the bottom of the Field calculator.

Hope this helps,
Eric 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Error running VBA code: User Interrupt / Field Calculator: Overflow 
Author William Edwards 
Date Aug 05, 2009 
Message I have a similar error but after I hit okay when the error running VBA code: user interrupt pops up. Mine is not dealing with numbers but rather than an integer. Here is my code:
dim result as string
dim position as integer
position=instr( [legal_desc],"T & P")
result=mid( [legal_desc],position,5)

My prof was unable to help, please anyone! This is for my thesis. 
 
dim result as string
dim position as integer
position=instr( [legal_desc],"T & P")
result=mid( [legal_desc],position,5)
 
  Expression.cal (opens in new window)
 
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Error running VBA code: User Interrupt / Field Calculator: Overflow 
Author Carlos Armas 
Date Feb 01, 2010 
Message Hello,
I was wondering if you were able to find the solution to your ptoblem. I am getting the same error message "Error running VBA code: User Interrupt" using the following code

 
 
Dim Pctle As Integer

Dim FthPctle As Integer

If [PERCENTILE]  = "5th" 
Then FthPctle = 1
Else
  FthPctle = 0
End If

5thPctle = FthPctle