workbook_BeforeClose

  • Thread starter Thread starter OlieH
  • Start date Start date
O

OlieH

This macro execuitesOK when one to closes the workbook. However, apparently
the Excel engine resets all of the variables, public and private. I would
appreciate any help in getting around this. I need to key on what was
previously set in VB. All help is greatly appreciated.
Olie H
 
public twbn as string
macro1() 'iin module1
twbn = "NO"
application.quit
end sub
_______________________
sub Enditall(A)
rem clean up at this point
exit sub
______________
Public sub workbook_beforeClose(cancel as Boolean) 'in ThisWorkbook
if twbn = "YEs" then cancel = false: exit sub
rem there is additional code but at this poing twbn is alway = ""
,...,
end sub

Thanks JLGWhiz for the response
 

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

Back
Top