C
canoe414
OS: W2K SP4
app: Excel 2000
I've written a sub in VBA to read in a file.
This works....
Dim fso As Object
Dim txtstream As TextStream
Set fso = CreateObject("Scripting.FileSystemObject")
Set txtstream = fspenTextFile("C:\mystuff\tteestfile.txt",
ForReading)
But I don't want to hardcode the fully-pathed filename. So I tried....
Dim fso As Object
Dim txtstream As TextStream
Set fso = CreateObject("Scripting.FileSystemObject")
Set txtstream =
fspenTextFile(Server.MapPath("tteestfile.txt"), ForReading)
but got an "Object not found" msg on line 4
Then I tried...
Dim fso As Object
Dim txtstream As TextStream
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set txtstream =
fspenTextFile(Server.MapPath("tteestfile.txt"), ForReading)
but this threw an "Object not found" on line 3
Seems like for some reason my script can't "see" Server objects, yet
there are many examples on the web using this syntax. What gives?
The point of all this is to determine the current working directory,
which then is used to build up the fully-pathed filename to stick in
the OpenTextFile method. Help!
TIA,
Steve
app: Excel 2000
I've written a sub in VBA to read in a file.
This works....
Dim fso As Object
Dim txtstream As TextStream
Set fso = CreateObject("Scripting.FileSystemObject")
Set txtstream = fspenTextFile("C:\mystuff\tteestfile.txt",
ForReading)
But I don't want to hardcode the fully-pathed filename. So I tried....
Dim fso As Object
Dim txtstream As TextStream
Set fso = CreateObject("Scripting.FileSystemObject")
Set txtstream =
fspenTextFile(Server.MapPath("tteestfile.txt"), ForReading)
but got an "Object not found" msg on line 4
Then I tried...
Dim fso As Object
Dim txtstream As TextStream
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set txtstream =
fspenTextFile(Server.MapPath("tteestfile.txt"), ForReading)
but this threw an "Object not found" on line 3
Seems like for some reason my script can't "see" Server objects, yet
there are many examples on the web using this syntax. What gives?
The point of all this is to determine the current working directory,
which then is used to build up the fully-pathed filename to stick in
the OpenTextFile method. Help!
TIA,
Steve