My Assistant
|
|
Feb 23 2012, 12:42 PM
Post
#1
|
|
|
New Member Posts: 17 From: Connecticut |
I'm getting a "Runtime Error 5 - Invalid procedure call or argument" error on what looks like a very simple line of code. I've been staring at it for hours, and I can't see any reason this should be causing an error. Below is a snippet of my code. When I debug, the error is occurring at the If...Then line.
For Y = 1 To X - 1 If strVend(Y) = strVend(X) Then intVendMatch = intVendMatch + 1 End If Next Y At the point that the error occurs, the variable values are: Y (Integer) = 1 X (Integer) = 2 strVend(1) (String) = "27539" strVend(2) (String) = "27539" I can't see any reason for an error message here. The If...Then statement should just compare the 2 values, see that they are equal, and move on. I've tried everything I can think of here. The problem may very well lie outside my project, but I'm a loss... Any advice would be greatly appreciated! I'm running Office 2010 on Windows XP, by the way. |
|
|
|
bfras914 Runtime Error 5 - I Can't Find The Problem Feb 23 2012, 12:42 PM
Bob G where is the code for strvend ?? Feb 23 2012, 12:52 PM
bfras914 dim strVend(100) as String
Values are stored to t... Feb 23 2012, 01:15 PM
bfras914 I still have no idea why I was getting this error,... Feb 24 2012, 09:12 AM
Bob G you know you cannot compare strings to numbers unl... Feb 24 2012, 09:25 AM
bfras914 Yes, I know that. I started with 2 strings, and I... Feb 24 2012, 12:03 PM
bfras914 I've encountered this error several other time... Mar 20 2012, 04:13 PM![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 19th June 2013 - 02:14 PM |