+ Reply to Thread
Results 1 to 2 of 2

VBA create txt file from cell contents on Excel 2011 (Mac) VBA

  1. #1
    Registered User
    Join Date
    London, England
    MS-Off Ver
    Excel 2011 (Mac)

    VBA create txt file from cell contents on Excel 2011 (Mac) VBA


    I have been triying to write some code that creates an individual txt file from a cell's contents and saves it in a specified filepath (for a collection of cells I have put in a named range). Easy enough using Excel on my PC, however when I use a Mac (like the person I'm writing the code for) I receive Error 429 as the code I'm using clearly uses ActiveX which is not supported on Macs.

    How do I modify the code so it will work on a Mac?

    I have pasted the code I have writted below for reference, I would be sincerely grateful for any help with the matter. Please let me know if any additional information is needed.

    Thanks in advance

    Sub Export_Text2()

    Dim i As Integer

    For i = 1 To Range("N").Value
    Set txtApp = CreateObject("Scripting.FileSystemObject")
    Set txtDoc = txtApp.CreateTextFile(Range("FileNames")(i, 1).Value, True)
    txtDoc.WriteLine (Range("Text")(i, 1).Value)
    Next i

    End Sub

  2. #2
    Registered User
    Join Date
    MS-Off Ver
    Excel 2010 Mac

    Re: VBA create txt file from cell contents on Excel 2011 (Mac) VBA


    I'm working on some similar sort of coding. I came across this page that I thought would help:

    I've tried following the instructions on there to see if it will work. I don't think my knowledge of VBA is good enough to know where I'm going wrong, but it could help shed some light on your problem?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread


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