On 7/21/06 5:08 AM, in article
1153472885.853097.228860@s13g2000cwa.googlegroups.com, "catlair"
> Hi Bob,
>
[quoted text clipped - 46 lines]
>> fileopen=false
>> End function
The function above returns TRUE if the work is open, FALSE if not. So,
you'll have to use a statement in another sub to do that. To close a file:
If fileopen("test.xls") workbooks("test.xls").close
To close all files except this one:
Sub CloseThemAll()
Dim XX as variant
for each xx in workbooks
if xx.name<>thisworkbook.name then xx.close
next
End sub

Signature
Bob Greenblatt [MVP], Macintosh
bobgreenblattATmsnDOTcom
catlair - 27 Jul 2006 11:11 GMT
Hi Bob,
Thanks! It works like a dream! How do I enable it to run every time I
open the workbook where this macro resides as a workbook module?
> On 7/21/06 5:08 AM, in article
> 1153472885.853097.228860@s13g2000cwa.googlegroups.com, "catlair"
[quoted text clipped - 65 lines]
> next
> End sub
Bob Greenblatt - 27 Jul 2006 12:34 GMT
On 7/27/06 6:11 AM, in article
1153995111.074126.140790@i42g2000cwa.googlegroups.com, "catlair"
> Hi Bob,
>
[quoted text clipped - 70 lines]
>> next
>> End sub
Call the sub from the workbook open event. Or, if the sub is in a module,
name the sub "Auto_Open".

Signature
Bob Greenblatt [MVP], Macintosh
bobgreenblattATmsnDOTcom
catlair - 28 Jul 2006 03:57 GMT
Thanks, Bob! Works like a charm! :-)
> On 7/27/06 6:11 AM, in article
> 1153995111.074126.140790@i42g2000cwa.googlegroups.com, "catlair"
[quoted text clipped - 80 lines]
> Call the sub from the workbook open event. Or, if the sub is in a module,
> name the sub "Auto_Open".