#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Opened File

"Combo" wrote in message
...
Are there a function in VBA programming has return if a file of excel

if
already opeded by other user in my intranet?


The only way I know of is to just open the workbook and check to see if
VBA has opened as read-only. If so it means the workbook is already opened
by another user. For example:

Dim wkb As Workbook
Set wkb = Workbooks.Open("E:\Book1.xls", , , , , , True)
If wkb.ReadOnly Then
MsgBox wkb.Name & " is open by another user."
wkb.Close
End If

Note that the IgnoreReadOnlyRecommended flag has been set to True so you
don't mistake files saved as read-only recommended for files that are open
by another user.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


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 03:57 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"