• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 695
  • Last Modified:

Save Excel File as a Tab Delimited File

How can I modify the code below to save the OutPutFileName file as a Tab Delimited File

Public Sub saveSheets(InputFileName as String,OutPutFileName as String)

  Dim xlApp As Object
  Dim xlBook As Object
  Dim xlSheet As Object
  Dim strOutputFileName

  Set xlApp = CreateObject("Excel.Application")
  Set xlBook = xlApp.Workbooks.Open(InputFileName)  ' Excel File
  For Each xlSheet In xlBook.Worksheets    
    xlSheet.SaveAs OutPutFileName   ' Needs to save as Tab Delimited File
  Next
  xlApp.Quit

End Sub
0
Phil Chapman
Asked:
Phil Chapman
  • 2
  • 2
1 Solution
 
Martin LissOlder than dirtCommented:
xlSheet.SaveAs OutPutFileName FileFormat:=xlText
0
 
Phil ChapmanAuthor Commented:
MartinLiss
I goto the errors below

Set xlApp = CreateObject("Excel.Application")
  Set xlBook = xlApp.Workbooks.Open(InputFileName)
  For Each xlSheet In xlBook.Worksheets
    xlSheet.SaveAs OutPutFileName
    xlSheet.FileFormat = xlText


    xlSheet.SaveAs OutPutFileName  FileFormat:=xlText
    Syntax Error in VB6

    I then tried

    xlSheet.FileFormat = xlText
    xlSheet.SaveAs OutPutFileName
    Object doesn't support this property method in vb6

  Next
  xlApp.Quit
0
 
Martin LissOlder than dirtCommented:
It looks like it's a WorkBook function


   ActiveWorkbook.SaveAs FileName:= OutPutFileName, FileFormat:=xlText
0
 
Phil ChapmanAuthor Commented:
Solution did not work and expert provided no follup up
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now