![writing vb code in excel mac os writing vb code in excel mac os](https://excelchamps.com/wp-content/uploads/2019/11/window-excel-visual-basic-editor1-1536x821.png)
Also, many other people are using the workbook with no problems. On all the Mac’s I have tested my workbook on, it works fine.
![writing vb code in excel mac os writing vb code in excel mac os](https://i.stack.imgur.com/EDieP.png)
(My code creates a new folder inside the Data folder, and then saves an Excel file into that new folder.) But my code is written to save the file in a particular folder that should always be accessible by Excel, regardless of the sandbox limitation:
#WRITING VB CODE IN EXCEL MAC OS FOR MAC#
I know that starting with Excel for Mac 2016, Excel is “sandboxed”, meaning you cannot save files wherever you want via VBA code. It only seems to happen on Excel for Mac 20. It does not appear that this error occurs on Excel for Mac 2011. Run-time error ‘1004’: Method ‘SaveAs’ of object ‘_Workbook’ failed. For a few people, when this moment occurs, the VBA code in the workbook generates an error. One of the things the workbook does is save a separate Excel file on the user’s computer in a very specific folder, the first time the file is opened on that computer. Thus, I am struggling to figure out what’s causing it. However, a few people on Mac are reporting an issue that I cannot reproduce on any of the Mac’s I have access to.
![writing vb code in excel mac os writing vb code in excel mac os](https://www.techonthenet.com/excel/macros/images/visual_basic_editor2011_001.gif)
I released the first version of the file publicly back in November, and for most people, it is working fine. I’ve created a Macro-Enabled Excel workbook for using on Excel for Mac & Windows.