+ Reply to Thread
Results 1 to 3 of 3

Can't save XLSX file to specific folder on Mac (Excel 2011)

  1. #1
    Registered User
    Join Date
    11-03-2012
    Location
    California
    MS-Off Ver
    Excel 365
    Posts
    6

    Can't save XLSX file to specific folder on Mac (Excel 2011)

    I have a workbook that I am trying to get to work on both the Windows & Mac versions of Excel. So far so good on Windows. I'm having a problem on Excel 2011 for Mac right now, and can't seem to figure out why. Google searching has not turned up a solution.

    One of the things my workbook does is it creates a new workbook, and I want to save that new workbook to a specific folder on the Mac. That folder (on my Mac) is:

    El Capitan:mattc:Library:Containers:com.microsoft.Excel:Data:Test Folder:

    All of those folders exist. In fact, my code will create the "Test Folder" folder if it does not already exist.

    My code will create the new workbook, but when it tries to save it, I run into the problem. The line of code causing the error is:

    Please Login or Register  to view this content.
    For the sake of my testing, here is what the variables are:

    FileNameAndPath = "El Capitan:mattc:Library:Containers:com.microsoft.Excel:Data:Test Folder:TestFile.xlsx"

    FilePassword = "password2019"

    On Excel 2019 for Mac, this works perfectly. On Excel 2011, I am getting this error:

    Run-time error '1004':

    Microsoft Excel cannot access the file 'El Capitan:mattc:Library:Containers:com.microsoft.Excel:Data:Test Folder:88544000'. There are several possible reasons:

    - The file name or path name does not exist.
    - The file you're trying to open is being used by another program. Close the document in the other program, and try again.
    - The name of the workbook you're trying to save is the same as the name of another document that is read-only. Try saving the workbook with a different name.

    I remember seeing this error once before on Windows, when I was trying to write a file inside the "Program Files" folder. I assumed I did not have permission to access that folder. But I don't understand why I would not have permission to access the folder in question here, especially when it works fine in Excel 2019.

    I know that it is possible for Excel VBA to write a file to this particular folder on Mac, because I have a workbook (not created by me) that does it. Unfortunately, the code on that workbook is password-protected, so I can't see how they do it.

    Anyone have any ideas what might be wrong?
    Last edited by mcomp72; 02-04-2019 at 12:32 AM.

  2. #2
    Registered User
    Join Date
    11-03-2012
    Location
    California
    MS-Off Ver
    Excel 365
    Posts
    6

    Re: Can't save XLSX file to specific folder on Mac (Excel 2011)

    UPDATE: I just tried changing the folder where my code would save the file, to the Documents folder. I received the same error. Then I changed it to the Desktop. Again, I received the same error. So it appears I do not have permission to save a file anywhere on my computer using VBA code. Has anyone experienced this before? It is bizarre, to say the least.

  3. #3
    Registered User
    Join Date
    11-03-2012
    Location
    California
    MS-Off Ver
    Excel 365
    Posts
    6

    Re: Can't save XLSX file to specific folder on Mac (Excel 2011)

    I finally figured it out. My string of the path was wrong. I had forgotten to include "Users" before my username.

+ 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. Replies: 1
    Last Post: 12-01-2016, 10:57 AM
  2. Change File from txt to xlsx and Save in Current Folder
    By freybe06 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2016, 05:21 PM
  3. Replies: 3
    Last Post: 01-05-2014, 05:50 AM
  4. Replies: 1
    Last Post: 12-10-2013, 12:11 PM
  5. [SOLVED] Can Excel do calculations ie count number of .xlsx files in a specific folder on pc
    By blacktie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-19-2013, 06:13 AM
  6. [SOLVED] Macro to save file as XLSX in the same folder from where it originated
    By balandri in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-07-2013, 02:28 PM
  7. How to add the columns data of several xlsx files of a folder in another xlsx file
    By ravikumar00008 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-25-2012, 04:29 AM

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