+ Reply to Thread
Results 1 to 11 of 11

I need a saveas format that works in both Excel 2011 and 2016 for Mac

  1. #1
    Registered User
    Join Date
    07-11-2009
    Location
    South Gippsland, Australia
    MS-Off Ver
    Excel 2011 (Mac)
    Posts
    31

    I need a saveas format that works in both Excel 2011 and 2016 for Mac

    I have a macro that creates a new xlxs file which I want to save with a name passed to the macro via the clipboard. This code works in Excel 2011, saving the file in the same folder as the file running the macro.

    ActiveWorkbook.SaveAs FileName:=FileName, _
    FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False

    but it fails in Excel 2016.

    I want a format that works in both. I have the option of passing a specific file path to the macro if that will help, in fact that was where I started out but got tangled up in the differing path protocols for 2011 and 2016.

    What's the simplest solution?

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: I need a saveas format that works in both Excel 2011 and 2016 for Mac

    Have you looked at

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    07-11-2009
    Location
    South Gippsland, Australia
    MS-Off Ver
    Excel 2011 (Mac)
    Posts
    31

    Re: I need a saveas format that works in both Excel 2011 and 2016 for Mac

    No, and looking for examples on the web has me even more confused. Can you show me how I might use that method to achieve my initial objective?

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: I need a saveas format that works in both Excel 2011 and 2016 for Mac

    I'm not sure I understand your objective.
    But, if you put that line in a single line sub and run it, you could determine if it was a helpful tool.
    Note that the dummy arguments I included with the function can be customized for your situation.

  5. #5
    Registered User
    Join Date
    07-11-2009
    Location
    South Gippsland, Australia
    MS-Off Ver
    Excel 2011 (Mac)
    Posts
    31

    Re: I need a saveas format that works in both Excel 2011 and 2016 for Mac

    My objective is to save an untitled file as a named xlxs file in a manner that is compatible with both Excel 2011 and excel 2016. I have no idea what the arguments are or how I should use them and I can't find any useful advice on the web. It would be very helpful if you could suggest what code I might use.

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: I need a saveas format that works in both Excel 2011 and 2016 for Mac

    Are you using Application.Pathseparator to get the correct file path format?
    Rory

  7. #7
    Registered User
    Join Date
    07-11-2009
    Location
    South Gippsland, Australia
    MS-Off Ver
    Excel 2011 (Mac)
    Posts
    31

    Re: I need a saveas format that works in both Excel 2011 and 2016 for Mac

    NO. I'm passing the path as a parameter, either:

    Macintosh HD:Sundry docs:Panorama stuff:Super Excel Export:
    or
    /Sundry docs/Panorama stuff/Super Excel Export/

    depending on the version of Excel. Within the macro, the choice is made by this code:

    If Right(Left(Application.Version, 2), 1) < "4" Then
    ActiveWorkbook.SaveAs FileName:=FilePath1 & FileName, _
    FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
    Else
    ActiveWorkbook.SaveAs FileName:=FilePath2 & FileName, _
    FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
    End If

    The second one causes the macro to fail in Excel 2016.

    Is it possible to give me a simple code snippet that will work in both versions? if you wanted to write code that worked in both versions, what would you write? With respect, it doesn't seem to me to be a challenging question to an experienced user. Surely somebody must have already done this at some time.

  8. #8
    Registered User
    Join Date
    07-11-2009
    Location
    South Gippsland, Australia
    MS-Off Ver
    Excel 2011 (Mac)
    Posts
    31

    Re: I need a saveas format that works in both Excel 2011 and 2016 for Mac

    Is it possible to give me a simple code snippet that will work in both versions? if you wanted to write code that worked in both versions, what would you write? With respect, it doesn't seem to me to be a challenging question to an experienced user. Surely somebody must have already done this at some time

    Please, can anybody answer this?

  9. #9
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: I need a saveas format that works in both Excel 2011 and 2016 for Mac

    You haven't actually said what the problem is ("fails" isn't very descriptive) so I'll guess that you're running into Apple's sandboxing requirements. In which case, I suggest you read this: http://www.rondebruin.nl/mac/mac034.htm

    As you will see, it's nowhere near as straightforward as it is in Windows or previous Mac versions.

  10. #10
    Registered User
    Join Date
    07-11-2009
    Location
    South Gippsland, Australia
    MS-Off Ver
    Excel 2011 (Mac)
    Posts
    31

    Re: I need a saveas format that works in both Excel 2011 and 2016 for Mac

    I realise that "fails" isn't very helpful but I'm working under some difficulty in That I don't have a copy Excel 2016 so I'm dependent on a friend to do that end of the testing for me and I'm getting second-hand information.

    I was hoping that somewhere on this forum there would be somebody who has Excel 2016 and who could just provide me with a single line of code that worked in that environment. All I'm getting is clues as to how I might make myself an Excel 2016 expert without actually owning the software. This means that every test I try has to be shipped off to somebody else to run and report back.

    I retire injured. Thank you all.

  11. #11
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: I need a saveas format that works in both Excel 2011 and 2016 for Mac

    Did you read the link I posted?

+ 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. VBA to autosize comment box in MS Excel 2011 NOT WORKING in MS Excel 2016
    By Black Panther in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-18-2018, 12:36 PM
  2. Macro built in Excel 2011 crashes workbook in Excel 2016
    By NCRB_10 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2018, 12:31 AM
  3. VBA code not working on Mac machine running Excel 2011 (works fine on Windows!)
    By LochWulf in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-19-2016, 11:25 PM
  4. checking if hyperlink works in excel document - Excel for Mac 2011
    By gro1 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 07-21-2016, 06:02 PM
  5. Code works in Windows excel 2003 and 2010 but crashes in Mac excel 2011
    By kiweed in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2012, 08:46 PM
  6. [SOLVED] Excel 2011 on Mac VBA Macro help works on PC will not on mac.
    By frisbie17 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 8
    Last Post: 07-26-2012, 09:09 PM
  7. Replies: 0
    Last Post: 03-19-2012, 07:32 PM

Tags for this Thread

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