View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JDH JDH is offline
external usenet poster
 
Posts: 13
Default Run macro with BeforeSave Event

Macro is in "ThisWorkbook"

Private Sub Workbook_BeforeSave()
ThisWorkbook.Save
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"C:\Mold Release Verification\QSA Mold Release Verification.htm",
FileFormat _
:=xlHtml, ReadOnlyRecommended:=True, CreateBackup:=False
Application.DisplayAlerts = True
End Sub

Error message: Compile error - Precedure declaration dose not match or
procedure having the same name.

"Barb Reinhardt" wrote:

What's the code and where does it have an error.
--
HTH,
Barb Reinhardt



"JDH" wrote:

Hi again,

I have a macro that I am running on a BeforeClose event and I need it to run
on a Workbook_BeforeSave event. When I click Save I receive an error message.
As of now I having to use:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Save
mymarcro
End Sub