December 2, 2020 at 4:18 pm
This vbscript for Excel that opens a pipe delimited file is failing
srccsvfile = Wscript.Arguments(0)
destxlsfile = Wscript.Arguments(1)
Set objExcel = GetObject(,"Excel.Application")
objExcel.Visible = false
objExcel.displayalerts=false
Set objWorkbook = Workbooks.OpenText (srccsvfile, Origin:=xlMSDOS, StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar:="|")
Set wkbTemp = ActiveWorkbook
Set objWorksheet1 = objWorkbook.Worksheets(1)
It's failing on the OpenText line.
Microsoft VBScript compilation error: Expected ')'
Any ideas?
December 3, 2020 at 10:29 am
You have got a lot of problems here chief. I'm guessing you've copied some VBA code but that wont work the same.
HTH
December 3, 2020 at 1:19 pm
I switched to just Open with all the parameters and it's working now.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy