Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Is workbook open on network drive

Is there a way to tell if a workbook is open on a network drive? If someone
has this workbook open, there name will be in sheet1 range A1.

Is there a statement that can tell me 1. if the workbook is open and 2. the
name of the person who has it open (range A1)?

i have played with referring to it as such, but am not sure of the rest of
the code i should use.

workbooks("\\servername\folder name\file name.xls")
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Is workbook open on network drive

On Tue, 18 Mar 2008 07:16:00 -0700, Spencer Hutton
wrote:

Is there a way to tell if a workbook is open on a network drive? If someone
has this workbook open, there name will be in sheet1 range A1.

Is there a statement that can tell me 1. if the workbook is open and 2. the
name of the person who has it open (range A1)?

i have played with referring to it as such, but am not sure of the rest of
the code i should use.

workbooks("\\servername\folder name\file name.xls")


Open on your machine? This won't account for mapped drives, but it may give
you a start

Dim wb As Workbook

On Error Resume Next
Set wb = Workbooks("BackOrderReport.xls")
On Error GoTo 0

If wb Is Nothing Then
MsgBox "Workbook not open"
Else
If Left$(wb.Path, 2) = "\\" Then
MsgBox "Workbook open on network drive by " &
wb.Sheets(1).Range("a1").Value
Else
MsgBox "Workbook open locally"
End If
End If
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com
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
Excel can't open network drive! Meneos Excel Discussion (Misc queries) 3 September 5th 08 12:43 PM
user cannot access his share workbook on network drive. Phil Excel Worksheet Functions 0 September 26th 06 04:30 PM
Can't open excel on network drive, it said somebody has opened it soe soe Excel Discussion (Misc queries) 1 December 1st 05 01:02 PM
How do I open a file from a Network drive using Excel VBA? turnerje Excel Programming 1 August 2nd 05 10:43 PM
Excel 2k3: Workbook on network drive, when save creates new file AVCCTech Excel Discussion (Misc queries) 1 July 7th 05 08:05 PM


All times are GMT +1. The time now is 03:41 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"