close

Is there an event that fires when a workbook is saved or closed. I have
tried adding workbook_save and workbook_close functions (to the thisworkbook
object), but the code that I put in never fires. The workbook_open seems to
work ok. I am using Excel 2003.

Thanks,
Workbook_BeforeSave
Workbook_BeforeClose

If you are at the ThisWorkbook's code page, you will see at the top of
the window two drop-down boxes. At first, in an empty module, the left
one says: (General). If you choose ThisWorkbook instead, then the right
box will contain all the workbook-level event procedures.

HTH
Kostis Vezerides
quot;tkquot; gt; ha scritto nel messaggio
...
gt; Is there an event that fires when a workbook is saved or closed. I have
gt; tried adding workbook_save and workbook_close functions (to the
thisworkbook
gt; object), but the code that I put in never fires. The workbook_open seems
to
gt; work ok. I am using Excel 2003.
gt;
gt; Thanks,
gt;
gt;

I don't understand. I have the following code and work fine:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
MsgBox (quot;Your Workbook is in order to be closedquot;)
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
MsgBox (quot;Your Workbook is in order to be savedquot;)
End Sub

--
Ciao
Thunder

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()