From: ordnance1 on 28 Apr 2010 17:30 I was using the line below at the end of my code and all was well. Until someone had other Excel workbooks open (besides the one I had created) and the code ran doing what it was supposed to do and closed excel completely. I do want the Excel to close down, but only if my workbook is the only workbook open. So is there any way to amend what I have to check for other open workbooks, and if there are any open the just close my workbook only? Application.Quit
From: Suri on 28 Apr 2010 17:51 On Apr 28, 10:30 pm, "ordnance1" <ordnan...(a)comcast.net> wrote: > I was using the line below at the end of my code and all was well. Until > someone had other Excel workbooks open (besides the one I had created) and > the code ran doing what it was supposed to do and closed excel completely.. I > do want the Excel to close down, but only if my workbook is the only > workbook open. > > So is there any way to amend what I have to check for other open workbooks, > and if there are any open the just close my workbook only? > > Application.Quit Try Application.ActiveWorkbook.Close(SaveChanges:=False)
|
Pages: 1 Prev: Excel Export to Access via VBA Next: Who is in a network shared Excel file |