I have created a small Excel pricing model, that includes the attached vba to force a workbook Save_As to protect the template model in it's original format. When input is made to a certain cell, a workbook change routine calls this module to force the save as to a renamed .xlsm workbook. This works fine on my mac but the save as fails on the user pc (Windows 10). Can the code be amended to solve this? Cell B13 contains the reference being used as part of the file name.
Sub SaveAs_New_XLSM_Workbook() 'Save as xlsm file using the reference cell value Dim wsA As Worksheet Dim wbA As Workbook Dim strName As String Dim strPath As String Dim strFile As String Dim strPathFile As String Dim myFile As Variant On Error GoTo errHandler Set wbA = ActiveWorkbook Set wsA = ActiveSheet 'Get active workbook folder strPath = wbA.Path If strPath = "" Then strPath = Application.DefaultFilePath End If strPath = strPath & "\" strName = wsA.Range("B13").Value 'Create default name and save for file strFile = strName & ".Model.xlsm" strPathFile = strPath & strFile ActiveWorkbook.SaveAs filename:=strFile 'Confirmation message with file info MsgBox "Hello Rob, " & cbCrLf _ & vbCrLf & vbCrLf & _ "This workbook has been saved as a customer model: " _ & vbCrLf & vbCrLf & _ strPathFile ExitHandler: Exit Sub errHandler: MsgBox "Could not save file" Resume ExitHandler End Sub