Help pLease... Creating a Usage Log

A

Alpineman2

I am trying to create a usage log, below is the code:

Private Sub Workbook_Open()
Open ThisWorkbook.Path & "\usage.log" For Append As #1
Print #1, Application.UserName, Now
Close #1
End Sub

However, I don't know where the log is stored therefore am not sure if it is
working.
Would someone be able to help me?
Your guidance will be greatly appreciated.

Thank you,

J.B.
 
G

Gord Dibben

The usage.log file is stored in the folder from which you opened the workbook

I tested the code and it works.

The code creates the file on first open then appends username and date/time each
time the workbook is opened.

Find it in the folder and open with NotePad to check.


Gord Dibben MS Excel MVP
 
A

Alpineman2

Gord Dibben,
Thank you, I feel stupid now, should have noticed the usage log right in
front of my face.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top