File I/O

<< Click to Display Table of Contents >>

Navigation:  Macro Samples >

File I/O

  iFile = Freefile
  sFile = "C:dummy.txt"
  sTmp = "      "
  result = MsgBox ("sFile=" & sFile , vbOK ,"Continue")
  result = MsgBox ("iFile=" & str(iFile) , vbOK ,"Continue")
  Open sFile For Input as iFile
  result = MsgBox ("About to prime read",vbOK,"Continue")
  LineInput #iFile, sTmp
  result = MsgBox ("First read done",vbOK,"Continue")
  While NOT EOF (iFile)
       MsgBox sTmp, vbOK ,"Processing"
       LineInput #iFile, sTmp
  Wend
  Close #iFile
  result = MsgBox ("Finished",vbOK,"Continue")
End