GetSaveAsFileName on a Mac

We can use the custom code below to let the user browse to a location and enter a file name. The result(path/filename) we use in the code that really save the file. There are a few nice parameters that you can use with GetSaveAsFileName that all work OK in Windows but not on a Mac, Filefilter is a very important one that is not working on a Mac. The basic example code below is something that is close to what you can do in Excel for Windows but if you have suggestions please let me know.

Below you find a macro and custom function that you can use to let the user save the ActiveWorkbook in the format you want and get the correct FileFormat of the selected extension. This is important because the extension and the FileFormat must match, if not you can't open the saved file.

You see that it is one line of code that you can use in your own code to call the custom function to save the ActiveWorkbook. In the macro below that call the function I add one line that create a workbook with one sheet each time you run the macro so it is easy to test the function. Please read the comments in the macro good so you know how to use it.

Test macro and custom function

2/5/23
Web design by Will Woodgate