Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating an access log


Is it at all possible to create a text file, so that when any user opens
a particular spreadsheet, their username and current system date is
appended to the text file?

I'm inerested in creating an access log for one of our spreadsheets.
I'm no VBA expert, but i'm assuming this might quite straight forward.
Havent got a clue how to get the user's login ID, or Excel User name,
so any help will be appreciated.

thanks in advance,
Matt


--
matpj
------------------------------------------------------------------------
matpj's Profile: http://www.excelforum.com/member.php...o&userid=21076
View this thread: http://www.excelforum.com/showthread...hreadid=528071

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Creating an access log

Yes, I answered the same question a while back but cannot remember the link;
search this group for access log
--
- K Dales


"matpj" wrote:


Is it at all possible to create a text file, so that when any user opens
a particular spreadsheet, their username and current system date is
appended to the text file?

I'm inerested in creating an access log for one of our spreadsheets.
I'm no VBA expert, but i'm assuming this might quite straight forward.
Havent got a clue how to get the user's login ID, or Excel User name,
so any help will be appreciated.

thanks in advance,
Matt


--
matpj
------------------------------------------------------------------------
matpj's Profile: http://www.excelforum.com/member.php...o&userid=21076
View this thread: http://www.excelforum.com/showthread...hreadid=528071


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating an access log


hi,

thanks for the response.
I couldn't find a post with a reply frmo you, but I found another on
that does exactly what I want, although the spreadsheet I am creatin
will be saved in a Notes database.

I need the log file to be in a specified network path although when
try to use that, it throws up an error.

the original code for the log is:


Code
-------------------
Sub DoTheLog(myKey As String)
Open ThisWorkbook.Path & "\" & Left(ActiveWorkbook.Name, _
Len(ActiveWorkbook.Name) - 4) & "_usage.log" For Append As #1
Print #1, myKey & vbTab & Application.UserName _
& vbTab & fOSUserName _
& vbTab & fOSMachineName _
& vbTab & Format(Now, "mmmm dd, yyyy hh:mm:ss")
Close #1
End Su
-------------------


i'm trying to change the Open bit to read:


Code
-------------------
Open "\\Cs_fs1\Prodvol\Techserv\" & Left(ActiveWorkbook.Name, _
Len(ActiveWorkbook.Name) - 4) & "_usage.log" For Append As #1

-------------------


but when I do this it displays an error saying cannot find path.
That is a valid path and it is currently mapped to my PC

--
matp
-----------------------------------------------------------------------
matpj's Profile: http://www.excelforum.com/member.php...fo&userid=2107
View this thread: http://www.excelforum.com/showthread.php?threadid=52807

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Creating an access log

matpj,
What does the "Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4)"
part evaluate to ?

NickHK

"matpj" wrote in
message ...

hi,

thanks for the response.
I couldn't find a post with a reply frmo you, but I found another one
that does exactly what I want, although the spreadsheet I am creating
will be saved in a Notes database.

I need the log file to be in a specified network path although when I
try to use that, it throws up an error.

the original code for the log is:


Code:
--------------------
Sub DoTheLog(myKey As String)
Open ThisWorkbook.Path & "\" & Left(ActiveWorkbook.Name, _
Len(ActiveWorkbook.Name) - 4) & "_usage.log" For Append As #1
Print #1, myKey & vbTab & Application.UserName _
& vbTab & fOSUserName _
& vbTab & fOSMachineName _
& vbTab & Format(Now, "mmmm dd, yyyy hh:mm:ss")
Close #1
End Sub
--------------------


i'm trying to change the Open bit to read:


Code:
--------------------
Open "\\Cs_fs1\Prodvol\Techserv\" & Left(ActiveWorkbook.Name, _
Len(ActiveWorkbook.Name) - 4) & "_usage.log" For Append As #1

--------------------


but when I do this it displays an error saying cannot find path.
That is a valid path and it is currently mapped to my PC.


--
matpj
------------------------------------------------------------------------
matpj's Profile:

http://www.excelforum.com/member.php...o&userid=21076
View this thread: http://www.excelforum.com/showthread...hreadid=528071



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating an access log


that makes sure that the ".xls" is removed from the file name when
giving a name to the log file! :)


--
matpj
------------------------------------------------------------------------
matpj's Profile: http://www.excelforum.com/member.php...o&userid=21076
View this thread: http://www.excelforum.com/showthread...hreadid=528071



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
Creating pivot table from Access database Cam Excel Discussion (Misc queries) 1 March 19th 08 06:28 PM
Creating spreadsheet from access query. projectmergeleader Excel Discussion (Misc queries) 1 September 6th 07 03:48 PM
Creating Excel Worksheets from Access Database jack Excel Discussion (Misc queries) 0 March 14th 07 04:19 PM
Creating an access table with ADO JJ Excel Programming 4 March 10th 05 10:04 AM
Creating Access DB PO Excel Programming 6 August 25th 04 11:40 AM


All times are GMT +1. The time now is 04:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"