jimvg
New member
Hi,
I need to open a semicolon delimited file.
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
xlApp = CType(CreateObject("Excel.Application"), Excel.Application)
xlBook = CType(xlApp.Workbooks.Add, Excel.Workbook)
xlSheet = CType(xlBook.Worksheets(1), Excel.Worksheet)
Dim strDelimitedSourceFilename As String = "C:\Delimited.txt"
Dim strExcelOutputFilename As String = "C:\Report.xls"
xlApp.Workbooks.OpenText(Filename:="C:\BeverlyReports\DelimitedDA.txt", Origin:=437, StartRow:=1, DataType:=Excel.XlTextParsingType.xlDelimited, TextQualifier:=Excel.XlTextQualifier.xlTextQualifierDoubleQuote, ConsecutiveDelimiter:=False, TAB:=False, Semicolon:=True, Comma:=False, Space:=False, Other:=False, TrailingMinusNumbers:=True)
xlSheet.SaveAs(strExcelOutputFilename)
xlApp.Quit()
This saves Report.xls empty.
I have found specific documentation on PIAs lacking. Does anyone have book or website suggestions?
Jim
I need to open a semicolon delimited file.
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
xlApp = CType(CreateObject("Excel.Application"), Excel.Application)
xlBook = CType(xlApp.Workbooks.Add, Excel.Workbook)
xlSheet = CType(xlBook.Worksheets(1), Excel.Worksheet)
Dim strDelimitedSourceFilename As String = "C:\Delimited.txt"
Dim strExcelOutputFilename As String = "C:\Report.xls"
xlApp.Workbooks.OpenText(Filename:="C:\BeverlyReports\DelimitedDA.txt", Origin:=437, StartRow:=1, DataType:=Excel.XlTextParsingType.xlDelimited, TextQualifier:=Excel.XlTextQualifier.xlTextQualifierDoubleQuote, ConsecutiveDelimiter:=False, TAB:=False, Semicolon:=True, Comma:=False, Space:=False, Other:=False, TrailingMinusNumbers:=True)
xlSheet.SaveAs(strExcelOutputFilename)
xlApp.Quit()
This saves Report.xls empty.
I have found specific documentation on PIAs lacking. Does anyone have book or website suggestions?
Jim