Link to home
Start Free TrialLog in
Avatar of Saqib Husain
Saqib HusainFlag for Pakistan

asked on

Type mismatch error

I am getting a type mismatch error on this location. I have no idea what could cause this error. Can anyone help me just by looking at this piece of code? I cannot send the code but I can respond to questions.

User generated image
Avatar of Norie
Norie

What is crdlist(i) when you get the error?
Avatar of Saqib Husain

ASKER

Crdlist is dimensioned as a variant with no dimensions.
And then split using the split command as shown above
The value of i is 2 and n is 235
User generated image
But why should it error out at Next i  ?
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I have been using the same format since long. Only when the size of the data changes to something (which I have not figured out yet) I get this error.
A string like '0-3898' can't be converted to Long.

If the purpose of the code is to convert to Long do you actually need the 0 &?
A string like '0-3898' can't be converted to Long.

If the purpose of the code is to convert to Long do you actually need the 0 &?
Rather than posting an image could you post the actual code and tell us the values (and types) of all the variables at the time of the error?
I never looked at anything else while the error was highlighted at Next i

Thanks a lot
You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015, Experts-Exchange Top Expert Visual Basic Classic 2012 to 2014