Results 1 to 4 of 4

Export Worksheets As Separate Tab Delimited Text Files

Threaded View

  1. #1
    Registered User
    Join Date
    03-06-2018
    Location
    USA
    MS-Off Ver
    Always up to date.
    Posts
    18

    Export Worksheets As Separate Tab Delimited Text Files

    I have a workbook with about 20 sheets in it that need to be exported as tab delimited text files. I was able to find a couple variations of a VBA code to do this, but they both yield errors when I try to run them.

    The first code I tried was:
    Sub SaveAllAsTsv()
    
        Dim WS As Excel.Worksheet
        Dim SaveToDirectory As String
        Dim filename As String
    
        SaveToDirectory = CreateObject("WScript.Shell").specialfolders("Desktop")
    
        For Each WS In ActiveWorkbook.Worksheets
            filename = SaveToDirectory & "\" & WS.Name & ".txt"
            WS.SaveAs filename, xlText, Local:=True
        Next
    
    End Sub
    On that I get the error:
    Run-time error '429':
    ActiveX component can't create object
    Does anyone know why this code isn't running properly on my computer? Perhaps it is because I am running a Mac?

    I am attaching a test file with a few sheets of dummy data and the VBA code for convenience.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 02-02-2017, 06:05 PM
  2. Export Columns to separate Text files
    By murtly in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-31-2014, 08:25 AM
  3. [SOLVED] Export rows to delimited txt files
    By jmspen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-07-2012, 05:20 PM
  4. Replies: 1
    Last Post: 10-30-2012, 06:34 PM
  5. Export worksheets from multiple workbooks into pipe delimited txts
    By anshul03 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-30-2012, 05:16 AM
  6. Replies: 0
    Last Post: 11-09-2009, 09:57 AM
  7. split it into groups of 100 and export it to separate .csvs or text files
    By Shaunclippo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-03-2006, 01:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1