View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
J.E. McGimpsey J.E. McGimpsey is offline
external usenet poster
 
Posts: 493
Default VBA capture File SaveAs Event

One way:

In the ThisWorkbook code module of your workbook:

Private Sub Workbook_Activate()
Application.CommandBars("Worksheet menu bar").Controls( _
"File").Controls("Save As...").OnAction = "mymacro"
End Sub

Private Sub Workbook_Deactivate()
Application.CommandBars("Worksheet menu bar").Controls( _
"File").Controls("Save As...").Reset
End Sub

where "mymacro" is a macro in a regular code module.


In article ,
"Linda Mcfarlane" wrote:

In an Excel VBA application, when the user selects File
from the toolbar then File SaveAs, I want to capture that
event. If that's not possible, If I could at least
capture the event when they select File from the toolbar
that would help.