View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone[_2_] Jim Cone[_2_] is offline
external usenet poster
 
Posts: 1,549
Default VBA Runs After Application.Quit

"Still working on this - the last workbook for some reason is not closing"
Corrupted workbooks are a problem and what they will do to workbook code is unpredictable.

I believe having multiple versions of Excel on your machine can help identify problems.
Sometimes that smoothly running piece of code has difficulties in another version.
(even if the "other" version will not be used to run the finished program, it pays to check)
--
Jim Cone
Portland, Oregon USA .
http://www.mediafire.com/PrimitiveSoftware .
(Extras for Excel add-in: convenience built-in)





"Andy"
wrote in message
...
On Tue, 19 Apr 2011 21:16:31 -0700, "Jim Cone"
wrote:

Try closing all workbooks before calling quit.
Something as simple as...
Workbooks.Close
Application.Quit

If you are automating Excel, then you have to call quit on the object reference not "Application".


Good tip - thank you. To make it work I ended up closing the
workbooks one by one - something like:

ActiveWorkbook.Close Savechanges:=False
Workbooks("Name_01.xls").Close Savechanges:=False

(Still working on this - the last workbook for some reason is not
closing)

As an aside, I always thought that "Application.Quit" will close all
workbooks no questions asked.

Again, Thank you.

Andy