SaveAs filename statement not working on mac laptops

01's

Board Regular
Joined
Jun 1, 2011
Messages
85
Hi Guys,

Thanks for reading my query.

I have written some procedures in VBA Excel on my win 10 laptop. But these procedures are intended to be used by some mac laptop users as well and they are facing error at this particular statement highlighted in red.
But this works fine in windows laptops.

temp1 = ThisWorkbook.Sheets("EVALUATION DETAILs").Range("F4").Value
temp2 = ThisWorkbook.Sheets("Wlcm Note").Range("G5").Value
Path = ThisWorkbook.Path

Msname = "Mystery_Shopper_" & temp1 & "_" & temp2

Application.DisplayAlerts = False

ThisWorkbook.SaveAs FileName:=Path & "" & Msname & "_" & Format(Now(), "DD-MMM-YYYY hh mm AMPM") & ".XLSB", FileFormat:=50

Thanks so much in advance.
 
Last edited:

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
I wish I could help. This used to work in Excel 2011 for Mac, but in Excel 2016 or later for Mac, we're working in a "sandbox" that protects Mac users from malicious code.

There are resources, for example on Ron de Bruin's site, that show how this is done. Start here:
Problems with Apple’s sandbox requirements and Mac Office 2016 with VBA code
I have not successfully made this work, so I've disabled these functions in my VBA programs.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top