LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.word.vba.beginners
external usenet poster
 
Posts: 10,593
Default Beginners question: how to stop / abort execution of vba program

But VBA ain't VB6, and all the things you mention are probably exactly what
he wants to happen, everything cleared down. The host application is still
running.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Jonathan West" wrote in message
...

"Ardus Petus" wrote in message
...
Use the End instruction
Just End, not End Sub or End Function


In the VB6 newsgroups, that kind of advice can start a flamewar:-)

The problem with using End is well described in the VBA help file.

"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.

The End statement provides a way to force your program to halt. For normal
termination of a Visual Basic program, you should unload all forms. Your
program closes as soon as there are no other programs holding references

to
objects created from your public class modules and no code executing."


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup





 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginners Question GordyB Excel Discussion (Misc queries) 3 February 1st 10 10:33 PM
Beginners Question Black_op51 Excel Discussion (Misc queries) 6 November 8th 06 11:46 PM
Stop Execution ArthurJ Excel Programming 2 September 10th 05 04:41 PM
Program execution prob PLPE[_11_] Excel Programming 2 June 30th 05 01:09 PM
stop execution al Excel Programming 3 October 2nd 04 01:20 AM


All times are GMT +1. The time now is 01:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"