[AccessD] End Statement in VBA

Stuart McLachlan stuart at lexacorp.com.pg
Wed Oct 29 18:30:06 CDT 2008


According to Access VBA Help file:

When executed, the End statement resets all module-level variables and all static local 
variables in all modules. To preserve the value of these variables, use the Stop statement 
instead. You can then resume execution while preserving the value of those variables.  

Note   The End statement stops code execution abruptly, without invoking the Unload, 
QueryUnload, or Terminate event, or any other Visual Basic code. Code you have placed in 
the Unload, QueryUnload, and Terminate events of forms and class modules is not 
executed. Objects created from class modules are destroyed, files opened using the Open 
statement are closed, and memory used by your program is freed. Object references held by 
other programs are invalidated.  


Note the second to last sentence.
So it looks as though the answer is Yes.

-- 
Stuart


On 30 Oct 2008 at 10:01, Darryl Collins wrote:

> Hi Folks,
> 
> One of the guys on the Excel-L list asked the following and no-one has
> gotten back to him (yet).  I found it a good question and wondered if
> anyone here knows the answer. 
> 
> ''--- Copied email follows---
> 
> Does the End statement (by itself -- which I think kills VBA runtime
> completely) dump variables from memory effectively?
> 
> ''--- End copy ---
> 
> Cheers
> Darryl.
> 
> This email and any attachments may contain privileged and confidential information
> and are intended for the named addressee only. If you have received this e-mail in
> error, please notify the sender and delete this e-mail immediately. Any
> confidentiality, privilege or copyright is not waived or lost because this e-mail
> has been sent to you in error. It is your responsibility to check this e-mail and
> any attachments for viruses.  No warranty is made that this material is free from
> computer virus or any other defect or error.  Any loss/damage incurred by using this
> material is not the sender's responsibility.  The sender's entire liability will be
> limited to resupplying the material.
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com





More information about the AccessD mailing list