I need to be able to count the no. of times a sprdsheet is opened

M

Melvin P

I have a spreadsheet on a common drive accessed by workmates. I need a simple
counter to tell me how many times the sheet is opened. Any assistance is
appreciated.
Cheers
 
J

Jason Lepack

Create a new workbook that is hidden in the same directory. Now in the
original spreadsheet create a macro that will run in the
"workbook_open" method that adds 1 to cell A1 in the hidden workbook.

Cheers,
Jason Lepack
 
E

Earl Kiosterud

For this to work, macros must be enabled. If the user elects not to run
macros (when the security level allows the user to choose whether to run
macros), then the counter won't get bumped. Also, the counter could be in
the actual workbook, if desired. It could be an unnoticed cell in a hidden
row or column, in a hidden sheet, or a named value (Insert - Name - Define)
which the macro could modify. The font color could be white, making it
invisible. The code should keep two of these counters. If they don't
agree, it's likely that a user has found one and changed it. Let the games
begin.

The VBA project could be locked to keep users from seeing what the code
does. Tools - VBA project properties - Protection tab - Lock project for
viewing. This is said to be more secure than Excel's passwords for stuff
like opening the file, protecting worksheets and workbooks, etc.
 
Top