Once the workbook is open, excel doesn't need or want that drive and path.
Try:
Workbooks("BOOK1.XLS").Close SaveChanges:=False
In fact, you may want to open it nicely, too:
Dim wkbk as workbook
set wkbk = workbooks(filename:="c:\xxx\book1.xls")
'do lots of stuff
wkbk.close savechanges:=false
When you're opening the file, you'll want to tell excel where to look -- not
just rely on the current directory.
Simon wrote:
>
> Hi
> When closing one workbook I want it to close another.
> I have tried
> Workbooks("C:XXX\BOOK1.XLS").Close SaveChanges:=False
>
> Which doesnt seem to work.
> Without making the other workbook active is there any other way to close it?
>
> Many thanks
> Simon
--
Dave Peterson
|