View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
onedaywhen onedaywhen is offline
external usenet poster
 
Posts: 459
Default Unauthorised Use Of Macro

Correct, the user cannot run workbook_beforeclose. But have you ever
wondered why a user *can* run workbook_open directly from the VBE?

"Tom Ogilvy" wrote in message ...
Use the workbook_beforeclose event instead.

http://www.cpearson.com/excel/events.htm

Regards,
Tom Ogilvy


Paul Moles wrote in message
...
I have an auto_close macro designed to reset toolbars etc.
once a user has finished with the workbook.

Is it possible to prevent users being able to run the
macro whilst the workbook is in use?

Many Thanks

Paul Moles
PS The code is protected using project properties, I am
trying to stop premature running.