LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Code not working

Nigel,
If the WB has not been saved, I get the "do you want to save Book1 ?"
prompt, as expected.
Depending you want the changes committed or not, you can use:
ThisWorkbook.Save
or
ThisWorkbook.Saved = True

Otherwise the code as expected.

But this cannot be a copy/paste of your working code, as "application" would
be "Application" in the VBE.

NickHK

"Nigel" wrote in message
...
I use this code at the end of a report, everything works fine if I step

thru
the code and Excel will close but if I let the code run on its own it asks

me
if I want to Exit exit then just stops any ideas

TimeOutSeconds = 3

Set WSH = New IWshRuntimeLibrary.WshShell

Res = WSH.Popup("Do you want to Exit Excel?", TimeOutSeconds, "Exit Excel

",
vbYesNo)
Select Case Res
Case vbYes
application.Quit
Case vbNo
Exit Sub
Case -1
application.Quit
Case Else
End Select



 
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
VBA Code Not Working tictox Excel Discussion (Misc queries) 3 October 25th 10 04:25 PM
Pop up code not working Ian Manning Excel Programming 3 April 3rd 06 05:48 PM
Code not working and can't see why Steve Excel Discussion (Misc queries) 3 December 31st 04 03:12 PM
why this code not working Bernie Deitrick[_2_] Excel Programming 0 September 2nd 03 05:08 PM
Code not working Bob Phillips[_5_] Excel Programming 5 August 14th 03 03:12 PM


All times are GMT +1. The time now is 06:55 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"