Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Log of each person that saved a file

Is there a way that I can keep a log of each person that saved a file and the
date and time

I use this code below but the area that the information is stored could be
changed if discovered...any help would be appreciated

Private Sub Workbook_BeforeSave(ByVal SaveAsUI _
As Boolean, Cancel As Boolean)
Sheets("Control").Range("V19").End(xlDown).Select
a_row = ActiveCell.Row
Sheets("Control").Range("V" & a_row + 1).Value = "Last Saved By " &
Environ("UserName")
Sheets("Control").Range("W" & a_row + 1).Value = Date
Sheets("Control").Range("X" & a_row + 1).Value = Time
End Sub


--
Helping Is always a good thing
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Log of each person that saved a file

You dont need to select the sheet or cell; instead try the below code..You
can have a separate sheet for logs which can be hidden...

Private Sub Workbook_BeforeSave(ByVal SaveAsUI _
As Boolean, Cancel As Boolean)
Dim a_row As Long
a_row = Sheets("Control").Cells(Rows.Count, "V").End(xlUp).Row + 1
Sheets("Control").Range("V" & a_row) = "Last Saved By " & Environ("UserName")
Sheets("Control").Range("W" & a_row) = Now
End Sub

--
Jacob


"QuietMan" wrote:

Is there a way that I can keep a log of each person that saved a file and the
date and time

I use this code below but the area that the information is stored could be
changed if discovered...any help would be appreciated

Private Sub Workbook_BeforeSave(ByVal SaveAsUI _
As Boolean, Cancel As Boolean)
Sheets("Control").Range("V19").End(xlDown).Select
a_row = ActiveCell.Row
Sheets("Control").Range("V" & a_row + 1).Value = "Last Saved By " &
Environ("UserName")
Sheets("Control").Range("W" & a_row + 1).Value = Date
Sheets("Control").Range("X" & a_row + 1).Value = Time
End Sub


--
Helping Is always a good thing

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Log of each person that saved a file

Thanks,

Is there a way I can hide the sheet so it's not vissable to the users as the
reason I'm doing this is because there arguments about who saved the file last
--
Helping Is always a good thing


"Jacob Skaria" wrote:

You dont need to select the sheet or cell; instead try the below code..You
can have a separate sheet for logs which can be hidden...

Private Sub Workbook_BeforeSave(ByVal SaveAsUI _
As Boolean, Cancel As Boolean)
Dim a_row As Long
a_row = Sheets("Control").Cells(Rows.Count, "V").End(xlUp).Row + 1
Sheets("Control").Range("V" & a_row) = "Last Saved By " & Environ("UserName")
Sheets("Control").Range("W" & a_row) = Now
End Sub

--
Jacob


"QuietMan" wrote:

Is there a way that I can keep a log of each person that saved a file and the
date and time

I use this code below but the area that the information is stored could be
changed if discovered...any help would be appreciated

Private Sub Workbook_BeforeSave(ByVal SaveAsUI _
As Boolean, Cancel As Boolean)
Sheets("Control").Range("V19").End(xlDown).Select
a_row = ActiveCell.Row
Sheets("Control").Range("V" & a_row + 1).Value = "Last Saved By " &
Environ("UserName")
Sheets("Control").Range("W" & a_row + 1).Value = Date
Sheets("Control").Range("X" & a_row + 1).Value = Time
End Sub


--
Helping Is always a good thing

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default Log of each person that saved a file

Sheets("Sheet1").visible =xlVeryHidden

or just Right Click the the sheet tab and select hide.

Note: If you dont want the user to see the worksheet then I would suggest
protecting the workbook with a passord so the user can not unhide your sheets.

Hope this helps! If so, let me know, click "YES" below.
--
Cheers,
Ryan


"QuietMan" wrote:

Thanks,

Is there a way I can hide the sheet so it's not vissable to the users as the
reason I'm doing this is because there arguments about who saved the file last
--
Helping Is always a good thing


"Jacob Skaria" wrote:

You dont need to select the sheet or cell; instead try the below code..You
can have a separate sheet for logs which can be hidden...

Private Sub Workbook_BeforeSave(ByVal SaveAsUI _
As Boolean, Cancel As Boolean)
Dim a_row As Long
a_row = Sheets("Control").Cells(Rows.Count, "V").End(xlUp).Row + 1
Sheets("Control").Range("V" & a_row) = "Last Saved By " & Environ("UserName")
Sheets("Control").Range("W" & a_row) = Now
End Sub

--
Jacob


"QuietMan" wrote:

Is there a way that I can keep a log of each person that saved a file and the
date and time

I use this code below but the area that the information is stored could be
changed if discovered...any help would be appreciated

Private Sub Workbook_BeforeSave(ByVal SaveAsUI _
As Boolean, Cancel As Boolean)
Sheets("Control").Range("V19").End(xlDown).Select
a_row = ActiveCell.Row
Sheets("Control").Range("V" & a_row + 1).Value = "Last Saved By " &
Environ("UserName")
Sheets("Control").Range("W" & a_row + 1).Value = Date
Sheets("Control").Range("X" & a_row + 1).Value = Time
End Sub


--
Helping Is always a good thing

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Log of each person that saved a file

each sheet has a Visible property. you can set this to xlSheetHidden or
xlSheetVeryHidden as well as xlSheetVisible
the very hidden method means the user would have to go into the IDE and
examine the sheet properties, or write a line of code to make the sheet
visible. A hidden ( as opposed to Very Hidden) can be unhidden via the
Format/Sheet Unhide menu


"QuietMan" wrote in message
...
Thanks,

Is there a way I can hide the sheet so it's not vissable to the users as
the
reason I'm doing this is because there arguments about who saved the file
last
--
Helping Is always a good thing


"Jacob Skaria" wrote:

You dont need to select the sheet or cell; instead try the below
code..You
can have a separate sheet for logs which can be hidden...

Private Sub Workbook_BeforeSave(ByVal SaveAsUI _
As Boolean, Cancel As Boolean)
Dim a_row As Long
a_row = Sheets("Control").Cells(Rows.Count, "V").End(xlUp).Row + 1
Sheets("Control").Range("V" & a_row) = "Last Saved By " &
Environ("UserName")
Sheets("Control").Range("W" & a_row) = Now
End Sub

--
Jacob


"QuietMan" wrote:

Is there a way that I can keep a log of each person that saved a file
and the
date and time

I use this code below but the area that the information is stored could
be
changed if discovered...any help would be appreciated

Private Sub Workbook_BeforeSave(ByVal SaveAsUI _
As Boolean, Cancel As Boolean)
Sheets("Control").Range("V19").End(xlDown).Select
a_row = ActiveCell.Row
Sheets("Control").Range("V" & a_row + 1).Value = "Last Saved By " &
Environ("UserName")
Sheets("Control").Range("W" & a_row + 1).Value = Date
Sheets("Control").Range("X" & a_row + 1).Value = Time
End Sub


--
Helping Is always a good thing




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default Log of each person that saved a file

If you want you could use this and it would ensure the sheet is hidden each
time the workbook is saved.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

Dim a_row As Long

With Sheets("Control")
a_row = .Cells(Rows.Count, "V").End(xlUp).Row + 1
.Range("V" & a_row) = "Last Saved By " & Environ("UserName")
.Range("W" & a_row) = Now
.Visible = xlVeryHidden
End With

End Sub
--
Cheers,
Ryan


"Ryan H" wrote:

Sheets("Sheet1").visible =xlVeryHidden

or just Right Click the the sheet tab and select hide.

Note: If you dont want the user to see the worksheet then I would suggest
protecting the workbook with a passord so the user can not unhide your sheets.

Hope this helps! If so, let me know, click "YES" below.
--
Cheers,
Ryan


"QuietMan" wrote:

Thanks,

Is there a way I can hide the sheet so it's not vissable to the users as the
reason I'm doing this is because there arguments about who saved the file last
--
Helping Is always a good thing


"Jacob Skaria" wrote:

You dont need to select the sheet or cell; instead try the below code..You
can have a separate sheet for logs which can be hidden...

Private Sub Workbook_BeforeSave(ByVal SaveAsUI _
As Boolean, Cancel As Boolean)
Dim a_row As Long
a_row = Sheets("Control").Cells(Rows.Count, "V").End(xlUp).Row + 1
Sheets("Control").Range("V" & a_row) = "Last Saved By " & Environ("UserName")
Sheets("Control").Range("W" & a_row) = Now
End Sub

--
Jacob


"QuietMan" wrote:

Is there a way that I can keep a log of each person that saved a file and the
date and time

I use this code below but the area that the information is stored could be
changed if discovered...any help would be appreciated

Private Sub Workbook_BeforeSave(ByVal SaveAsUI _
As Boolean, Cancel As Boolean)
Sheets("Control").Range("V19").End(xlDown).Select
a_row = ActiveCell.Row
Sheets("Control").Range("V" & a_row + 1).Value = "Last Saved By " &
Environ("UserName")
Sheets("Control").Range("W" & a_row + 1).Value = Date
Sheets("Control").Range("X" & a_row + 1).Value = Time
End Sub


--
Helping Is always a good thing

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
Excel 2007 - Open a file with more than one person xeribor Excel Discussion (Misc queries) 0 March 2nd 10 12:02 PM
How does more that one person edit an excel file on s drive LOU Excel Discussion (Misc queries) 4 January 30th 07 01:20 PM
Windows API to get network username of person with file open Paul Martin Excel Programming 7 December 2nd 05 04:31 PM
Create a prompt as a person saves a file ah Excel Worksheet Functions 4 February 9th 05 08:19 PM
How do I include the name of the last person who saved a Excel do. Valerie Excel Discussion (Misc queries) 1 February 7th 05 09:28 PM


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