View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
ellen lee ellen lee is offline
external usenet poster
 
Posts: 1
Default Close other open excel files

test
"Greg H." wrote in message
...
How can i modify this to prevent thisworkbook.name and another excel file
not
to close? I need the files "Daily Reports.xls" and "NPP_*" to stay open.
Thanks

"Joel" wrote:

Easy

for each wbk in workbooks
if wbk.name < ThisWorkbook.name then
workbooks(wbk.name).close
end if
next wbk

"anon" wrote:

HI,

I'd like my wb on opening to close all other excel files that are open
(prompting them to save first).

I'd also like to prevent the user opening any other excel files whilst
my wb is open.

Is this possible (and is it a stupid thing to try and do?)