View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Testing if file is open

Andrew,

Try something like

On Error Resume Next
Workbooks("BookName.xls").Close savechanges:= True ' or false
On Error Goto 0


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"andreww" wrote in message
...
Hi - Does anyone know of any code that will check if an xls is
open, and if it is, close it?

Regards

Andrew