Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Is file opened?

How can I see if an Excel file is already opened

Because when it is I can't save a new one with the same name

Many thx in advanc

DonaldVdD
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Is file opened?



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"DonaldVdD" wrote in message
...
How can I see if an Excel file is already opened?

Because when it is I can't save a new one with the same name.

Many thx in advance

DonaldVdD



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Is file opened?

Donald,

Here is a simple function you can use

Function IsFileOpen(wb As String)
Dim oWb As Workbook

On Error Resume Next
Set oWb = Workbooks(wb)
On Error GoTo 0
IsFileOpen = Not oWb Is Nothing
End Function

Works like this

MsgBox IsFileOpen("Premiership 2003.xls")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"DonaldVdD" wrote in message
...
How can I see if an Excel file is already opened?

Because when it is I can't save a new one with the same name.

Many thx in advance

DonaldVdD



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Is file opened?


http://support.microsoft.com?kbid=138621
XL: Macro Code to Check Whether a File Is Already Open

http://support.microsoft.com?kbid=291295
XL2002: Macro Code to Check Whether a File Is Already Open

http://support.microsoft.com?kbid=213383
XL2000: Macro Code to Check Whether a File Is Already Open

http://support.microsoft.com?kbid=184982
WD97: VBA Function to Check If File or Document Is Open

Will check if it is open.

--
Regards,
Tom Ogilvy


"DonaldVdD" wrote in message
...
How can I see if an Excel file is already opened?

Because when it is I can't save a new one with the same name.

Many thx in advance

DonaldVdD



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
go last row when file is opened Wanna Learn Excel Discussion (Misc queries) 4 December 2nd 08 10:06 PM
file links incorrect when file is re-opened s-steege Excel Worksheet Functions 2 November 8th 08 11:26 PM
When was file last opened? Frankie Excel Worksheet Functions 5 May 19th 07 08:28 PM
cannot open the excel file, the file is already opened cannot open the excel document Excel Discussion (Misc queries) 1 May 19th 06 07:45 AM
Copying the Editing in one file to Another opened XLS file Ahmad Excel Worksheet Functions 1 May 27th 05 02:04 PM


All times are GMT +1. The time now is 02:46 PM.

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"