Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default 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?)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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?)


  #3   Report Post  
Posted to microsoft.public.excel.programming
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?)



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
open and close files Chi Excel Worksheet Functions 2 May 28th 09 09:46 PM
How to open a list of excel files and get update, then close it? Eric Excel Discussion (Misc queries) 4 June 10th 07 08:58 AM
Open Save & Close All Files in Dir Diane Alsing Excel Programming 5 January 31st 05 07:47 PM
Open all linked files and close them. Malic Excel Programming 0 October 24th 03 08:20 PM


All times are GMT +1. The time now is 08:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"