excel - How to use Workbook_BeforeClose from a custom module -


i trying prompt user when tries close workbook this

private sub workbook_beforeclose(cancel boolean)   msgbox "changes has been detected. want export data ?" end sub 

i know code need placed in thisworkbook module. there way custom module ? need add functionality multiple workbooks used client part of up-gradation, done replacing old modules new modules.

you can use application.vbe object , workbook.vbproject modify file's vba. note requires excel performing upgrade has have setting "trust access vba project" toggled on (it can found in trust center under tab macro settings). when not needed anymore, it's option best left off though security reasons.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -