Guys, im trying to create a program that converts an excel file into a tab-delimited text file? is there a way on how to code it? thanks!
Printable View
Guys, im trying to create a program that converts an excel file into a tab-delimited text file? is there a way on how to code it? thanks!
Yes, using the Excel Object Model you can open the xls file and .SaveAs with the DOSText argument.
VB Code:
'... '... ThisWorkbook.SaveAs Filename:="C:\Text.txt", FileFormat:=xlTextMSDOS
thanks. one question.. how can i open an excel file using that excel object model?
:)VB Code:
Option Explicit 'Add a reference to MS Excel xx.0 Object Library Private Sub Command1_Click() Dim oApp As Excel.Application Dim oWB As Excel.Workbook Set oApp = New Excel.Application Set oWB = oApp.Workbooks.Open("C:\Book1.xls") oWB.SaveAs Filename:="C:\Text.txt", FileFormat:=xlTextMSDOS oWB.Close Set oWB = Nothing oApp.Quit Set oApp = Nothing End Sub