PDA

View Full Version : [SOLVED:] Set default folder for save dialog in Excel for Mac



Colin_In_BE
01-13-2023, 12:30 AM
Hello,

I have tried several solutions to set the save-file dialog default folder.
None have worked on Mac Excel/VBA.

Can anyone share some working code for Mac (Big Sur 11.7.2) Excel/VBA that I can use to set the default folder for a file-save dialog, before opening the file at the end of a hyperlink?

Here is what I want:


Sub SimpleExample()
Dim Website As String
Website = "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.zip?24e1f8f75f24ff1735cadf130163f7d0" ' Hyperlink to follow
<some code here to set the default save folder and hopefully indicate "Replace" for the dialog, without having to specify them manually>
ActiveWorkbook.FollowHyperlink Address:=Website, NewWindow:=True 'Open Website
End Sub

Many thanks.

June7
01-21-2023, 12:17 AM
Review https://stackoverflow.com/questions/37410565/saveas-function-works-on-microsoft-pc-but-not-on-mac/37411960#37411960

Colin_In_BE
01-21-2023, 01:22 AM
Thanks June7.
I finally implemented a "workaround" using AppleScript, which I call as an app from my VBA code.
And, your link confirms this as a viable approach for similar challenges on the Mac, rather than trying to solve them purely in VBA for Mac, which is what I was attempting to do initially.:thumb