Solved

Save Excel File as a Tab Delimited File

Posted on 2012-03-23
4
665 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 45

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 45

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now