We have been using some VBA Code in microsoft Excel 2011 with no faults for a long time. We are in the process if upgrading to Office 2019 but the VBACode keeps giving me errors. Eg when using the very simple code shown below to save the current file as WRS.xls
I have tried saving the file as a .xlsm
Private Sub CommandButton14_Click()
UserForm1.Hide
ChDir "/Volumes/frontoffice/Trading Activity"
ActiveWorkbook.SaveAs Filename:="/Volumes/frontoffice/Trading Activity/WRS.xls" _
, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.Run "WRS.xls!Back_to_Switcboard"
End Sub
I get a
Runtime Error 1004 Cannot access read only document message
If I delete the existing file called WRS.xls before executing the code the code works - but that is not what i need to achieve