Solved

Save Excel File as a Tab Delimited File

Posted on 2012-03-23
4
668 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 46

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 46

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

809 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