Distinguishing what is causing close

P

Peter Ostermann

Hi everyone,

I like to use the "Workbook_BeforeClose" event to program different actions
whether the workbook or the Excel application is beeing closed. Any ideas
how the cause of close can be realized? Thanks in advance for hints.

Peter Ostermann
 
F

Franz Erhart

1. Open VBA, means of Alt-F11
2. Open "DieseArbeitsmappe" - for german users, for others the name is
different
3. Select from dropdown menu object "workbook"
4. Select from dropdown menu prozedure "BeforeClose"
5. Enter your code to "Workbook_BeforeClose" as you wish
 
N

Norman Jones

Hi Franz,
2. Open "DieseArbeitsmappe" - for german users, for others the name is
different

I think that you are referring to the workbook's
ThisWorkbook module.

However, I think that Peter's question seeks
a method to differentiate the closure of a
workbook (e.g. ActiveWorkbook.Close)
from a closure caused by terminating the Excel
session.
 
P

Peter Ostermann

Hi, Norman,
However, I think that Peter's question seeks
a method to differentiate the closure of a
workbook (e.g. ActiveWorkbook.Close)
from a closure caused by terminating the Excel
session.
you describe exactly what I seek. I direct my question to the Microsoft
MVPs. May be one of you people have the info?
Thanks for any answer.

Regards
Peter
 
P

Peter Ostermann

Hi NG,

if there is no solution, please state that there is none. That could help
stopping from further seaching.

Thanks
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top