how stop comparison call giveaway workbook?
i have readonly comparison workbook containing vba application. concentration saves any information needs saved database, workbook always closed but saving (by sourroundings thisworkbook.saved = loyal beforeclose).
i have following problem:
user double-clicks workbook windows explorer, workbook opens.
user double-clicks second workbook windows explorer.
excel prompts: "myworkbook.xls already open. reopening means any changes finished discarded. wish giveaway myworkbook.xls?"
if user clicks "yes", workbook reopened without executing beforeclose eventuality handler instance already open.
this problem application, since means vicious cleanup formula beforeclose eventuality handler does executed.
can anyone advise vba fortitude this. be:
suppressing prompt giveaway workbook. instead silently already-open instance.
somehow beforeclose eventuality handler run uncanny instance before closed, i run cleanup code.
update:
this comparison 2003.
i absolved neglected prompt sourroundings "thisworkbook.saved = true" workbook_sheetchanged eventuality handler (the vba app grateful saving any information needs saved database, i don't caring carrying comparison saving changes).
however doesn't solve problem: i this, following double-clicking workbook path-finder silently reopens workbook, nonetheless still does but job "beforeclose" eventuality handler.
so paraphrase question:
- is there anyway controlling vba detect prevent workbook being reopened way?
update 2
accepting bkimmel's answer - does seem there vba proceed prevent eventuality within workbook.
the fortitude i'll exercise pierce concentration formula an xla add-in, automatically hallowed (if already loaded) workbook loaded. add-in hoop open beforeclose events, store information needs purify up.
Comments
Post a Comment