View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default How to ensure a VBA sub is run before closing a workbook

The event is correct. Did you put the code in the ThisWorkbook code module.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jacqui" wrote in message
...
What syntax would I use to make sure specific subs are run before Excel
closes the active workbook. These subs are error checks and I need VBA to
vet the data and alert the user there are errors before the workbook is
closed. Is it the Workbook_Before Close event?. I tried adding the

syntax
below but it didn't trigger the subs. Also would an On Save type event

(if
there is one) be a better alternative. Can anyone recommend a solution

with
some code please.
Many thanks
Jacqui

Private Sub Workbook_BeforeClose()

Qualifiers_Check
Disable_Check

End Sub