Compilation Error, Expected: =

Solved
develySIDE Posted messages 58 Status Member -  
develySIDE Posted messages 58 Status Member -
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 answer

  1. f894009 Posted messages 17417 Registration date   Status Member 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
    1. develySIDE Posted messages 58 Status Member
       
      Thank you very much
      0