Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Save Excel File as a Tab Delimited File

Posted on 2012-03-23
4
Medium Priority
?
692 Views
Last Modified: 2012-04-08
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
Comment
Question by:PhilChapmanJr
  • 2
  • 2
4 Comments
 
LVL 49

Expert Comment

by:Martin Liss
ID: 37758069
xlSheet.SaveAs OutPutFileName FileFormat:=xlText
0
 
LVL 2

Accepted Solution

by:
PhilChapmanJr earned 0 total points
ID: 37758211
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
 
LVL 49

Expert Comment

by:Martin Liss
ID: 37758503
It looks like it's a WorkBook function


   ActiveWorkbook.SaveAs FileName:= OutPutFileName, FileFormat:=xlText
0
 
LVL 2

Author Closing Comment

by:PhilChapmanJr
ID: 37820828
Solution did not work and expert provided no follup up
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question