LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
DS DS is offline
external usenet poster
 
Posts: 117
Default Identifying the user that has a workbook open?

Morning all,

Was wondering if anyone has a way to do the following...

From a submission form, data is transferred to a destination data table, set
up also in Excel. Should the data table currently be open by another user,
the submit abandons.

The standard "Workbook.xls is locked for editing by user XXXXX" message with
the option to Read Only/Notify etc has been replaced with a message stating
that the submit cannot be completed because someone else has the wb open -
not a problem. The data table closes etc blah blah.

What I'm wondering is whether anyone is familiar with a method whereby the
user that has the wb open can be extracted and placed into a custom message
such as the one above - so that if a single user has the data table open for
a significant period, he/she can be identified and hit round the head....

The code used, in case this is helpful, is:

****************
Application.DisplayAlerts = False
Workbooks.Open DB, ignorereadonlyrecommended:=True, Notify:=False
Application.DisplayAlerts = True
Set DBT = ActiveWorkbook

If DBT.ReadOnly = True Then
DBT.Close SaveChanges:=False
ThisWorkbook.Activate
Sheet1.Select
StrMsg = "The database is currently in use by another user. Please try
again later."
MsgBox StrMsg, vbCritical, "Submission Cancelled"
Exit Sub
End If
****************

And effectively, I would like to add the network logon id of the user who
currently has the target wb open to the StrMsg - which would normally appear
in the "standard" message if DisplayAlerts < False.

Any ideas?
Thanks!
 
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
Open workbook in user-defined folder pdberger Excel Programming 4 August 30th 05 09:39 PM
Identifying an open workbook / sheet John Pritchard[_3_] Excel Programming 3 November 25th 04 01:46 PM
How to create a URL and when user clicks it to open a Excel workbook Belinda Excel Programming 2 May 30th 04 01:06 PM
Check For Open Workbook by another User Mark Excel Programming 1 November 6th 03 03:45 AM
Excel not warning if another user has the workbook open Edward Chalk Excel Programming 2 July 21st 03 06:18 AM


All times are GMT +1. The time now is 09:02 AM.

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"