VB.net - Exact same code/program runs ok on 3 out of 4 identical computer setups

I have code/program that runs on four computers, basically just reads a text file.  It works on 3 of the 4 computers.  All computers are setup the same.

the exception that it throws on the one computer is index out of bounds.

Any idea why this would happen on just one and not the others.  When I debug the code step by step, all indexs are ok and not issues either.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
If the computers have been running for more than a week, they are no longer 'the same'.  Have you tried to debug the program on the computer that shows the problem?
Éric MoreauSenior .Net ConsultantCommented:
to they have the same regional settings?

do you know which line throws the exception?
keith1001Author Commented:
I don't have visual studio installed on these computers to debug, unless there is some other way?

Same regional settings on computers.

Here is the code part that is throwing the exception.

Sub ReadFileMachineCode()

        Dim x As Integer = 0
        Dim FileReader As StreamReader
        Dim filename As String
        Dim FileResultValues(8) As Integer
        filename = "c:\working\machinecodes\" & AutoCycle_MachineCode & ".csv"
        'MsgBox("Test:002" & AutoCycle_MachineCode)
            If AutoCycle_MachineCode <> "" Then
                FileReader = New StreamReader(filename)
                Do While Not FileReader.EndOfStream
                    'MsgBox("X= " & x)
                    Dim line As String = FileReader.ReadLine()
                    Dim fields() As String = line.Split(","c)
                    FileResultValues(x) = fields(1)
                    filevalue(x) = FileResultValues(x)
                    x = x + 1
            End If
        Catch ex As Exception
        End Try
    End Sub

Open in new window

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

Éric MoreauSenior .Net ConsultantCommented:
add a couple of msgbox here and there to check the values of line, fields(), x, ... and you will find out exactly where and what is the cause.

without access to your PC, code and file, we can't do much!
keith1001Author Commented:
Understand on not seeing the issue directly.

I have added msgbox, i think you may see a couple commented out in the code above.  I will add more and try to get you guys more information later today.  
keith1001Author Commented:
Found my problem, thanks to NotePad++.

The windows stock notepad app was adding an extra CR+LF at the end of the file, once I was able to see that with Notepad++ and delete them, it fixed my problem.

Donation to Notepad++ on its way.

Thanks guys for helping out...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
keith1001Author Commented:
had to also use notepad to investigate the file
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.