Solved

Monitoring Spreadsheet usage

Posted on 2011-02-22
15
190 Views
Last Modified: 2012-08-13
is it possible to record how long a user stayed in a spreadsheet regardless of whether they save it. So if the user clicks leaves the spreadsheet it records the time/date

Thanks
Seamus
0
Comment
Question by:Seamus2626
  • 7
  • 5
  • 3
15 Comments
 
LVL 24

Expert Comment

by:StephenJR
Comment Utility
So if the workbook is closed irrespective of whether it was saved?
0
 

Author Comment

by:Seamus2626
Comment Utility
Exactly

Thanks
Seamus
0
 
LVL 24

Expert Comment

by:StephenJR
Comment Utility
Seamus - what about this in the ThisWorkbook module? Suppose if you wanted it displayed elsewhere would need to rethink.
Dim t As Double

Private Sub Workbook_Open()

t = Now()

End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)

MsgBox Now() - t

End Sub

Open in new window

0
 

Author Comment

by:Seamus2626
Comment Utility
Could that work with the below i wonder? I have this code but it relys on user saving ss which isnt practical in this particular report

Can you apply the above to the below?

Thanks
Seamus
Option Explicit

Private Sub Workbook_BeforeClose(Cancel As Boolean)
With Sheets("check")
    .Range("B64000").End(xlUp).Offset(0, 2) = Now()
End With
ActiveWorkbook.Save
End Sub

Private Sub Workbook_Open()
With Sheets("check")
   .Range("B64000").End(xlUp).Offset(1, 0) = Environ("USERNAME")
   .Range("B64000").End(xlUp).Offset(0, 1) = Now()
End With
End Sub

Open in new window

0
 
LVL 24

Expert Comment

by:StephenJR
Comment Utility
Like this?
Dim t As Double

Private Sub Workbook_BeforeClose(Cancel As Boolean)
With Sheets("check")
    .Range("B64000").End(xlUp).Offset(0, 2) = Format(Now() - t, "h:mm:ss")
End With
ActiveWorkbook.Save
End Sub

Private Sub Workbook_Open()

t = Now()
With Sheets("check")
   .Range("B64000").End(xlUp).Offset(1, 0) = Environ("USERNAME")
   .Range("B64000").End(xlUp).Offset(0, 1) = Now()
End With
End Sub

Open in new window

0
 

Author Comment

by:Seamus2626
Comment Utility
Thats good Stephen, its recording the time i spent in there, the only problem is the file is saving on exit, so no one gets a prompt to save. Dangerous errors could be saved, can the prompt to save be retained while keeping the functionality to record the time spent in the ss?

Thanks
Seamus
0
 
LVL 24

Expert Comment

by:StephenJR
Comment Utility
What about commenting out line 7?
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 17

Expert Comment

by:gtgloner
Comment Utility
Have a look at this file:
Book1.xls
0
 

Author Comment

by:Seamus2626
Comment Utility
That didnt work without the save Stephen


gtgloner: that is what im looking for, but its not creating a list, i need it to keep building that data, so the next time it returns to  d2, then d3, so i can build a history of who was in the ss and for how long.

Thanks
Seamus
0
 
LVL 24

Accepted Solution

by:
StephenJR earned 250 total points
Comment Utility
Seamus - how so? If a change is made you'll be prompted to save, no?
0
 
LVL 17

Assisted Solution

by:gtgloner
gtgloner earned 250 total points
Comment Utility
OK, I think I have it now:
Book1.xls
0
 

Assisted Solution

by:Seamus2626
Seamus2626 earned 0 total points
Comment Utility
Problem is guys, if the user doesnt save on either approach, the data wont be saved on reopening that file......
0
 
LVL 17

Expert Comment

by:gtgloner
Comment Utility
Sounds fine to me.
0
 

Author Comment

by:Seamus2626
Comment Utility
Not sure why this question hasnt closed with the points assigned......
0
 

Author Closing Comment

by:Seamus2626
Comment Utility
thanks guys, i will be able to work the last part out

Cheers
Seamus
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now