ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   workbook_BeforeClose (https://www.excelbanter.com/excel-programming/408740-workbook_beforeclose.html)

OlieH

workbook_BeforeClose
 
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

JLGWhiz

workbook_BeforeClose
 
Maybe if you posted the code?

"OlieH" wrote:

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


OlieH

workbook_BeforeClose
 
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

"JLGWhiz" wrote:

Maybe if you posted the code?

"OlieH" wrote:

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



All times are GMT +1. The time now is 12:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com