Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am currently tracking several spreadsheets regarding username who opens it and when. I do this by extracting the username when the person opens the file(workbook open event) However since I store the data on one of the sheets I need to save the workbook every time. This OK when the wbook is shared but I cant use this when a user is read only. Is there a way to track these changes(username and time of usage) without those limitations? Thank you, Ozgur |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ozgur,
obviously you cannot save this information into this workbook. But you can have another file, that you can append with informations you need (username and time of usage). Regards, Ivan |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Write it out to a text file.
-- HTH Bob Phillips (remove nothere from email address if mailing direct) "Ozgur Pars" wrote in message ... Hi, I am currently tracking several spreadsheets regarding username who opens it and when. I do this by extracting the username when the person opens the file(workbook open event) However since I store the data on one of the sheets I need to save the workbook every time. This OK when the wbook is shared but I cant use this when a user is read only. Is there a way to track these changes(username and time of usage) without those limitations? Thank you, Ozgur |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bob,
thanks for the reply (Ivan you too) if I did understand correctly I should open a text file when the user opens this excel spreadsheet save the data on it and close it? Is there a intrinsic excel functionality which records such stuff? The reason I am asking in a recent post saw this function: Function DocProps(prop As String) '----------------------------------------------------------------- Application.Volatile On Error GoTo err_value DocProps = ActiveWorkbook.BuiltinDocumentProperties _ (prop) Exit Function err_value: DocProps = CVErr(xlErrValue) End Function "Bob Phillips" wrote: Write it out to a text file. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Ozgur Pars" wrote in message ... Hi, I am currently tracking several spreadsheets regarding username who opens it and when. I do this by extracting the username when the person opens the file(workbook open event) However since I store the data on one of the sheets I need to save the workbook every time. This OK when the wbook is shared but I cant use this when a user is read only. Is there a way to track these changes(username and time of usage) without those limitations? Thank you, Ozgur |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ozgur,
function you mention will not work with workbook open as read-only. You can use text file as Bob suggested (or any other file). If you decide to use text file, explore VBA help for opentextfile method. Regards, Ivan |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ozgur,
now I realized I was not clear. The function should work, but you will not be able to write its output to a file which is open as read-only. Regards, Ivan |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Ivan for your help
Ozgur "Ivan Raiminius" wrote: Hi Ozgur, now I realized I was not clear. The function should work, but you will not be able to write its output to a file which is open as read-only. Regards, Ivan |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That is one of my old posts :-)
That function can get you a document property but it has little to do with you ask. You need something like '----------------------------------------------------------------- Private Sub Workbook_Open() '----------------------------------------------------------------- Dim nFile nFile = FreeFile Open "C:\MyLog.txt" For Append As #nFile Print #nFile, "Workbook " & ThisWorkbook.Path & _ " opened by " & Environ("UserName") & _ " on " & Format(Now, "yyyy/mm/dd hh:mm:ss") Close #nFile End Sub -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Ozgur Pars" wrote in message ... Hi Bob, thanks for the reply (Ivan you too) if I did understand correctly I should open a text file when the user opens this excel spreadsheet save the data on it and close it? Is there a intrinsic excel functionality which records such stuff? The reason I am asking in a recent post saw this function: Function DocProps(prop As String) '----------------------------------------------------------------- Application.Volatile On Error GoTo err_value DocProps = ActiveWorkbook.BuiltinDocumentProperties _ (prop) Exit Function err_value: DocProps = CVErr(xlErrValue) End Function "Bob Phillips" wrote: Write it out to a text file. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Ozgur Pars" wrote in message ... Hi, I am currently tracking several spreadsheets regarding username who opens it and when. I do this by extracting the username when the person opens the file(workbook open event) However since I store the data on one of the sheets I need to save the workbook every time. This OK when the wbook is shared but I cant use this when a user is read only. Is there a way to track these changes(username and time of usage) without those limitations? Thank you, Ozgur |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob sorry didn't remember if it was you or Tom that wrote it...
Thanks again for your kind help... I will have a go at it tomrrow. Have a nice evening. Ozgur "Bob Phillips" wrote: That is one of my old posts :-) That function can get you a document property but it has little to do with you ask. You need something like '----------------------------------------------------------------- Private Sub Workbook_Open() '----------------------------------------------------------------- Dim nFile nFile = FreeFile Open "C:\MyLog.txt" For Append As #nFile Print #nFile, "Workbook " & ThisWorkbook.Path & _ " opened by " & Environ("UserName") & _ " on " & Format(Now, "yyyy/mm/dd hh:mm:ss") Close #nFile End Sub -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Ozgur Pars" wrote in message ... Hi Bob, thanks for the reply (Ivan you too) if I did understand correctly I should open a text file when the user opens this excel spreadsheet save the data on it and close it? Is there a intrinsic excel functionality which records such stuff? The reason I am asking in a recent post saw this function: Function DocProps(prop As String) '----------------------------------------------------------------- Application.Volatile On Error GoTo err_value DocProps = ActiveWorkbook.BuiltinDocumentProperties _ (prop) Exit Function err_value: DocProps = CVErr(xlErrValue) End Function "Bob Phillips" wrote: Write it out to a text file. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Ozgur Pars" wrote in message ... Hi, I am currently tracking several spreadsheets regarding username who opens it and when. I do this by extracting the username when the person opens the file(workbook open event) However since I store the data on one of the sheets I need to save the workbook every time. This OK when the wbook is shared but I cant use this when a user is read only. Is there a way to track these changes(username and time of usage) without those limitations? Thank you, Ozgur |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Employee login time sheet | Excel Discussion (Misc queries) | |||
How can i make time schedule sheet for login logout timmings | Excel Discussion (Misc queries) | |||
Time Tracking Help | Excel Discussion (Misc queries) | |||
Mac issue with macro recording user login & date (run time error ' | Excel Programming | |||
how do I set up an employee time in/out login | Excel Programming |