/ Published in: Visual Basic

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
OpenFileDialog: 'will return the absolute path of the file to upload FileToRead = Application.GetOpenFilename(, , "Find File", , False) If Not ((FileToRead = "False") Or (FileToRead = "")) Then '================ On first loop through file, check water controls =================== Open FileToRead For Input As #1 Do While Not EOF(1) ReadALine: Line Input #1, LineRead If LineRead = "" Then GoTo ReadALine Else 'Put in stuff to do to the line of data here End If Loop close #1 'This happens if the user presses Cancel when they are trying to open a file to read Else ans = MsgBox("You must select a file to read for the program to continue." & VbCrLf & VbCrLf & _ "Please select a file an try again.", vbOKCancel + vbInformation, "No File Selected") If ans = vbCancel Then MsgBox "The program is stopped." Exit Sub Else GoTo OpenFileDialog End If End If
Comments
