View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
AA2e72E AA2e72E is offline
external usenet poster
 
Posts: 400
Default Close all Instances of Excel

This script will close all instances of Excel and will NOT save any changes
made to the active workbookof each session: type the code in a file with
extension VBS, locate it in Explorer & double click.

CloseExcel
SUB CloseExcel()
on error resume next
set xl =getobject(,"Excel.Application")
xl.activeworkbook.saved = true
xl.Quit
set xl = nothing
call CloseExcel
End Sub

"Tod" wrote:

I guess this is more of a vbscript question, but what
would be the best code to close all open instances of
Excel?