ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Close other open excel files (https://www.excelbanter.com/excel-programming/398617-close-other-open-excel-files.html)

anon

Close other open excel files
 
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?)


joel

Close other open excel files
 
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?)



ellen lee

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?)





All times are GMT +1. The time now is 09:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com