How to tell Who Opened Excel File.

  • Thread starter Thread starter PS
  • Start date Start date
P

PS

Hello,

In a Network Computer, an Excel file is opened by someone (eg. PS)

When I open the Excel file, this message dialog is prompted

---------------------------------------------
aaa.xls is locked for editing by 'PS'

Open ..... ...... ....... ..... ..... ...... ...... in use.
---------------------------------------------

My Question is "Is there any way to extract 'PS' ?"
Maybe API ?

Thanks in advance.
 
Hi

Only way I know is to open read-only and read the WriteReservedBy property. This may or
may not work, depending on the network architecture or something like that.
 
Harald said:
Hi

Only way I know is to open read-only and read the WriteReservedBy property. This may or
may not work, depending on the network architecture or something like that.
I have tried this experiment on one of my own spreadsheets... Open it
with Notepad and in the first 2-3 lines of garble will have the name of
the last person to access the file. This may not answer your question,
or be technically accurate but it is interesting if nothing else.
Mike
 
Just a thought: if this is your workbook (or at least you have control
over it)and you want to know who is opening it, you could write code
in the Workbook_Open event which captures the user's userID, name, etc
(using Windows APIs) and persist these values somewhere visible to
you. An extension to this idea is to get the workbook to regularly
poll (using the OnTime method) a database, text file on the network,
etc where you can set a value to tell the workbook to close,
effectively throwing out the current user so that you can open the
workbook.
 

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

Back
Top