Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Eric Fung wrote: 1. Does the Friend property safer in terms of security ? I try to use the minimum scope possible e.g. if the connection isn't required outside of the VBA project then don't expose it via a public property/variable. Security isn't really a consideration here because an Excel workbook's VBA project isn't secure enough to contain sensitive information. 2. Although I see when the workbook is close, Office will help to close the connection for me. I hope to be more discipline, to close the connection by myself explicitly However, I've tried to code at ThisWorkbook event - "BeforeClose" and "Deactivate", either event seems happen after Office already close the connection for me. I'd use the _BeforeClose event, with the extra code required to handle the situation where the user cancels a save and therefore cancels the close. Module level variables in the ThisWorkbook code module should still be in scope (i.e. should not have been garbage-collected) when the _BeforeClose and _Deactivate events fire, unless something has happened to reset the VBA project e.g. hitting the reset button in the Visual Basic Editor, adding controls to a worksheet, etc. Jamie. -- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Startup and template locations in Citrix TS session and local session | Setting up and Configuration of Excel | |||
msn stock updates quit working & no internet connection in excel | Excel Discussion (Misc queries) | |||
Data Connection wizard quits working | Excel Discussion (Misc queries) | |||
Wondering why the following ADO connection to Access isn't working... | Excel Programming | |||
ADO Connection stopped working | Excel Programming |