Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Login ID over a network

Can anybody do this ?

Imagine a file sitting on a network drive (this file could
be an Excel Workbook or a text CSV file). It can be
accessed by anybody in the business.

Often people will go into this file (not ReadOnly) which
causes a problem because somebody somewhere might want to
update or overwrite it completely.

I want a macro that will check the status of this file ,
by returning not Just the Excel Name of a user whose
inside it, but also their login ID.

I understand using a shared workbook is an option to
solving the above problem , but this isnt always possible.
I also have the API code for returning the login from a
local machine.

So how do I get the login of a user in a workbook/CSV file
on a network drive ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Login ID over a network

As a quick fix (if it is a workbook) you could put a macro
in the Workbook_Open event that would write the User to a
central log log.
If you copy the below code in the code section of
ThisWorkbook it will illustrate what I mean. I tied the
rcording to Open and close events but you could also use
the save event.
It's not exactly what you are looking for but may provide
others with some additional ideas.
Felix

Private Sub Workbook_Open()
WriteLog ("Open")
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
WriteLog ("Close")
End Sub

Function WriteLog(ActionType As String)
Dim FileNum1, OutFile
On Error Resume Next
FileNum1 = FreeFile
OutFile = ThisWorkbook.Path + "\Users.log"

'Create the result file if not already there
Open OutFile For Append As FileNum1

Print #FileNum1, ActionType + "|" + _
UserLogon + "|" + _
ThisWorkbook.Name; "|" + _
CStr(Now())
Close #FileNum1
End Function

Function UserLogon()
Dim objNet
Set objNet = CreateObject("WScript.NetWork")
UserLogon = objNet.UserName
End Function

-----Original Message-----
Can anybody do this ?

Imagine a file sitting on a network drive (this file

could
be an Excel Workbook or a text CSV file). It can be
accessed by anybody in the business.

Often people will go into this file (not ReadOnly) which
causes a problem because somebody somewhere might want to
update or overwrite it completely.

I want a macro that will check the status of this file ,
by returning not Just the Excel Name of a user whose
inside it, but also their login ID.

I understand using a shared workbook is an option to
solving the above problem , but this isnt always

possible.
I also have the API code for returning the login from a
local machine.

So how do I get the login of a user in a workbook/CSV

file
on a network drive ?
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Login ID over a network

Something I've done before is to get an open workbook to regularly
(e.g. every five minutes) query a certain database/workbook/textfile
on the network for a value. If this value is set to true, the workbook
closes itself. Obviously, I'm in control database/workbook/textfile
and it provides me with a way of kicking someone out of the workbook
with five minutes' notice! A more refined approach could check whether
the current user's ID is on a list (either internal or external to the
workbook) to decide whether to close itself.

"Patrick" wrote in message ...
Can anybody do this ?

Imagine a file sitting on a network drive (this file could
be an Excel Workbook or a text CSV file). It can be
accessed by anybody in the business.

Often people will go into this file (not ReadOnly) which
causes a problem because somebody somewhere might want to
update or overwrite it completely.

I want a macro that will check the status of this file ,
by returning not Just the Excel Name of a user whose
inside it, but also their login ID.

I understand using a shared workbook is an option to
solving the above problem , but this isnt always possible.
I also have the API code for returning the login from a
local machine.

So how do I get the login of a user in a workbook/CSV file
on a network drive ?

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
SQL Server Login Ronald Excel Discussion (Misc queries) 14 December 2nd 08 11:27 AM
How can i stop Network Login pop-up while downloading excel Plabon Excel Discussion (Misc queries) 3 August 17th 07 04:56 PM
Login Box help Bill Lunney Excel Programming 0 August 20th 03 11:45 AM
Login Box Tom Ogilvy Excel Programming 0 August 8th 03 01:42 PM
Copying files ...Network to Network Eric[_6_] Excel Programming 2 July 18th 03 08:59 PM


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