Question Index Out Of Range Exception was unhandeld

Beware

Member
Joined
Dec 4, 2012
Messages
7
Programming Experience
3-5
I get this error:
Probleem.png

What is wrong with my code?
 

22-degrees

Well-known member
Joined
Feb 11, 2012
Messages
156
Location
South East Ireland
Programming Experience
1-3
You are missing 1 letter if that helps..... And it is on your "For" line where you should be looking.
 

22-degrees

Well-known member
Joined
Feb 11, 2012
Messages
156
Location
South East Ireland
Programming Experience
1-3
I would prefer to see you make the effort yourself. If you understand what the code you use does, then you can be a much better coder moving forward.

You have the Autos window open, the information is right there.. Try creating a variable to store the ofd.FileName.Count -1 value and see what the value is.. Then you will see why you are getting the OutOfRange error..
 

Beware

Member
Joined
Dec 4, 2012
Messages
7
Programming Experience
3-5
I would prefer to see you make the effort yourself. If you understand what the code you use does, then you can be a much better coder moving forward.

You have the Autos window open, the information is right there.. Try creating a variable to store the ofd.FileName.Count -1 value and see what the value is.. Then you will see why you are getting the OutOfRange error..
I know what I'm coding, i just made a typographical mistake. I read it 100 items but I just couldn't see it.

Thank you both!!!
 
Top Bottom