View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RG III RG III is offline
external usenet poster
 
Posts: 65
Default Error message: "Bad file name or number"

I know this code has worked for me before on other machines, but does anyone see a problem with this code:

'------------------------
Public Sub MyFileReader()

Dim f As Integer
Dim sFile As String

sFile = "C:\data.txt"

Open sFile For Input As f

Close f

End Sub
'-----------------------

The error message that I get is: "Bad file name or number".
And yes, the data.txt file exists on the root C: drive and the file is correctly named.

- Rob