Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Application.Quit out of Do loop

While doing some housekeeping on some old VBA procedures, I stumbled on this
anomaly of Application.Quit not executing out of a Do loop. Just wondered if
someone can explain why it is necessary to Exit Do before the Quit method
will execute?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Application.Quit out of Do loop

VBA's ability, on the odd occaision, to obfuscate what must be underlying
machine code logic, to a mirage of strange magic, leaves me stunned- Just as
well we love it eh?

"JLGWhiz" wrote:

While doing some housekeeping on some old VBA procedures, I stumbled on this
anomaly of Application.Quit not executing out of a Do loop. Just wondered if
someone can explain why it is necessary to Exit Do before the Quit method
will execute?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Application.Quit out of Do loop

See the difference of commenting out the DoEvents.

Private Sub CommandButton1_Click()
Dim i As Long, j As Long

For i = 1 To 100000
For j = 1 To 100000
If i = 500 And j = 1000 Then Application.Quit
Next
Debug.Print i, j
DoEvents
Next

End Sub

NickHK

"JLGWhiz" wrote in message
...
While doing some housekeeping on some old VBA procedures, I stumbled on

this
anomaly of Application.Quit not executing out of a Do loop. Just wondered

if
someone can explain why it is necessary to Exit Do before the Quit method
will execute?



Reply
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
difference application.quit & application.close Pierre via OfficeKB.com[_2_] Excel Programming 4 November 8th 05 07:55 PM
application.quit Murat Demir HEKIMOGLU Excel Programming 1 August 19th 05 09:02 AM
Application.Quit bawahoo[_2_] Excel Programming 2 October 14th 04 08:33 PM
macro to close excel application other than application.quit mary Excel Programming 1 September 14th 04 03:43 PM
application.quit will not shut off application john Excel Programming 0 January 9th 04 11:29 PM


All times are GMT +1. The time now is 09:56 PM.

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"