I am a novice at coding in vbscript and I have a problem that has been
bothering me for about a week. I am trying to write a script that will
open a text file and import it into excel (snippet of the code is
below). When I try to use the opentext function as shown below, I
received an error stating that "opentext method of wrokbooks class
failed" can anyone please explain to me why this is happening adn how
to correct it. I am sure the file exist in the same directory as the
script.
Dim excelprog
Set excelprog = WScript.CreateObject("Excel.Application")
excelprog.Application.Visible = True
excelprog.Workbooks.OpenText ("c:\test.txt", 437, 1, xlDelimited, 1,
False, False, True, False, False, False, , , comma, comma)