Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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



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
testing. do not open. S S Excel Worksheet Functions 1 April 16th 06 01:16 AM
Testing for an open file Nigel Excel Programming 3 July 11th 05 06:41 AM
Testing if a file is open John Baker Excel Programming 3 January 29th 04 01:26 AM
Testing for a open worksheet from Outlook Phillips[_3_] Excel Programming 1 December 30th 03 07:45 AM
Testing for open workbook nigelab Excel Programming 4 November 2nd 03 04:31 PM


All times are GMT +1. The time now is 11:42 PM.

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

About Us

"It's about Microsoft Excel"