Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / December 2007

Tip: Looking for answers? Try searching our database.

Limiting number of users opening Excel Workbook at one time.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RickatMDG - 20 Dec 2007 18:35 GMT
We are trying to limit the number of users that are able to open and work on
an Excel Workbook at the same time to one at a time.  Is there a way to
configure the sheets to do this?
rdwj - 20 Dec 2007 18:53 GMT
tricky!
What you can try is to use a markerfile (with just one number, ie the number
of current users).
Look under help under "Write" and "Get" how to manage input files.
If you include some VB code in Workbook_Open and Workbook_BeforeClose then
you can use the markerfile as a counter.
Something like

Type Record    ' Define user-defined type.
   ID As Integer
   Name As Integer
End Type

Dim MyRecord As Record, Position    ' Declare variables.

' Open sample file for random access.
Open "TESTFILE" For Random As #1 Len = Len(MyRecord)
' Read the sample file using the Get statement.
Position = 1    ' Define record number.
Get #1, Position, MyRecord    ' Read third record.

'which will give the variable MyRecord the number in the file
'Now check
if MyRecord > 4 then
    msgbox("to many users, file will autoclose")
    application.close
end if

Write #1, MyRecord + 1

Close #1    ' Close file

in the Workbook_BeforeClose include a similar statement....

> We are trying to limit the number of users that are able to open and work on
> an Excel Workbook at the same time to one at a time.  Is there a way to
> configure the sheets to do this?  
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.