G
Guest
Hi There,
I have received some info through this posting, but it is not working how i
want to.
Hoppefully someone can help me further?
I have a Macro in a Module (Workbook_save)
Sub Workbook_Save()
Dim rng As Range
Set rng = ActiveSheet.Range("M2")
ActiveWorkbook.SaveAs _
Filename:=rng.Value & ".xls", _
FileFormat:=xlWorkbookNormal
End Sub
And a macro to start up the above in This workbook:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Call Workbook_Save
Cancel = True
End Sub
But for some reason it is not saving the file as supose to do, i get the
error:
Compile Error - Expected variable or Proceder, not module
How can tell me what this is and how to fix?
Thanks
I have received some info through this posting, but it is not working how i
want to.
Hoppefully someone can help me further?
I have a Macro in a Module (Workbook_save)
Sub Workbook_Save()
Dim rng As Range
Set rng = ActiveSheet.Range("M2")
ActiveWorkbook.SaveAs _
Filename:=rng.Value & ".xls", _
FileFormat:=xlWorkbookNormal
End Sub
And a macro to start up the above in This workbook:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Call Workbook_Save
Cancel = True
End Sub
But for some reason it is not saving the file as supose to do, i get the
error:
Compile Error - Expected variable or Proceder, not module
How can tell me what this is and how to fix?
Thanks