Compilation Error, Expected: =

Solved
develySIDE Posted messages 58 Status Membre -  
develySIDE Posted messages 58 Status Membre -
Bonjour,

I am currently working on a macro for a button that saves my file in a folder, so I am using the saveAs function in VBA, but it tells me "Compilation Error, Expected: ="

Here is the code, if anyone has an idea?

Private Sub BoutonSauve_Click() ActiveWorkbook.SaveAs Filename:="G:\COURS\COURS\STAGE2\vba\maSave.xlsm", FileFormat:=xlOpenXMLTemplateMacroEnabled End Sub

1 réponse

f894009 Posted messages 17417 Registration date   Status Membre Last intervention   1 717
 
Hello,

without parentheses: ActiveWorkbook.SaveAs Filename:="G:\COURS\COURS\STAGE2\vba\maSave.xlsm", FileFormat:=xlOpenXMLTemplateMacroEnabled with: x = ActiveWorkbook.SaveAs(Filename:="G:\COURS\COURS\STAGE2\vba\maSave.xlsm", FileFormat:=xlOpenXMLTemplateMacroEnabled)
0
develySIDE Posted messages 58 Status Membre
 
Thank you very much
0