+ Reply to Thread
Results 1 to 6 of 6

VBA - Export Sheet to Tab Delimited Text (Mac Office 365) - Read Only Error

  1. #1
    Registered User
    Join Date
    04-01-2020
    Location
    London,UK
    MS-Off Ver
    365 (Mac)
    Posts
    3

    VBA - Export Sheet to Tab Delimited Text (Mac Office 365) - Read Only Error

    Hi all,

    Longtime viewer and first time poster. I'm trying very simply to use a VBA macro to;

    - Copy a sheet to a new workbook
    - Save As the sheet to be 'ExExport.txt' in tab delimited format (in the current folder that the original spreadsheet was in)
    - Close the workbook

    I feel like I'm on the right track, but I have exhausted my google searching and forum trawling skills so I thought I'd ask. I should also point out that I am running this on a Mac in office 365 v16.

    Please Login or Register  to view this content.
    This current script runs up the error 'Run-time error '1004'".Cannot access read-only document "exexport.txt".

    If anyone is able to offer any advice it would be greatly appreciated.

    TIA Dan

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: VBA - Export Sheet to Tab Delimited Text (Mac Office 365) - Read Only Error


    Hi,

    check first if the text file already exists, try with another file name …

  3. #3
    Registered User
    Join Date
    04-01-2020
    Location
    London,UK
    MS-Off Ver
    365 (Mac)
    Posts
    3

    Re: VBA - Export Sheet to Tab Delimited Text (Mac Office 365) - Read Only Error

    Tried multiple times with various file names still to no avail. Regardless if the file exists or not I would at least like a prompt to overwrite?

    Does anyone have any idea what I'm missing? Is there something specific to the Mac version of office 365, the macro I used to use doesn't work in this package either?

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: VBA - Export Sheet to Tab Delimited Text (Mac Office 365) - Read Only Error

    Have a read of...
    https://answers.microsoft.com/en-us/...184c67b?page=1

    And...
    http://www.rondebruin.nl/mac/mac034.htm

    Oh and make sure that you have latest update to Office 365 applied.

    It's to do with Apple's sandbox requirement. Which VBA doesn't handle well on it's own (since VBA hasn't been updated for ages).
    "Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
    ― Robert A. Heinlein

  5. #5
    Registered User
    Join Date
    04-01-2020
    Location
    London,UK
    MS-Off Ver
    365 (Mac)
    Posts
    3

    Re: VBA - Export Sheet to Tab Delimited Text (Mac Office 365) - Read Only Error

    Thanks CK76!

    Working through that helped a great deal! I've managed to get the active sheet to copy and store into a folder as a text document, however I can't seem to make it tab delimited.

    I believe the filetype is xlText, that CBA only seems to allow for file type numbers. I had a look on docs.microsoft.com/en-gb/office/vba/api/Excel.XlFileFormat - and have tried most of them. Can't seem to find how to make that happen?

    Please Login or Register  to view this content.
    Thanks for your help guys!

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: VBA - Export Sheet to Tab Delimited Text (Mac Office 365) - Read Only Error

    Not sure on that one as I don't use Mac all that much.

    May be try 19, which is xlTextMac... though I have my doubts.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Export designated sheet as CSV comma delimited
    By vio.coman in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-28-2020, 08:04 AM
  2. Export Sheets to Text Delimited CSV file
    By matrix2280 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-12-2018, 05:01 PM
  3. Export Worksheets As Separate Tab Delimited Text Files
    By etudes in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-14-2018, 06:51 PM
  4. VBA to read in tab delimited text file
    By DaveNUFC in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-01-2016, 12:28 PM
  5. Export to Tab-Delimited Text File Not working!
    By AGALLEGOS in forum Excel General
    Replies: 1
    Last Post: 09-17-2014, 11:20 AM
  6. [SOLVED] Export to Tab Delimited Text Error
    By reitanospa1@yahoo.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2006, 11:25 AM
  7. Replies: 2
    Last Post: 11-28-2005, 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