Microsoft Excel ReadOnly User in File get value using

Posted on 2008-11-19
Last Modified: 2012-05-05
I am trying to find out how I can display the person that is accessing an excel file if a user of my application tries to open the file that is already in use.  If an excel file is readonly, what is the syntax to get the username in the file?  I can see the info 'Acessed By' on the server in the 'Open Files' folder in the computer management console... but how do I get that information programatically?
Question by:logoncom
    LVL 83

    Expert Comment

    I think you can use WMI

    Author Comment

    what is WMI ?
    LVL 96

    Accepted Solution

    WMI = Windows Management Instrumentation

    There are tools from SysInternals that let you find how who has a file locked.  

    Windows SysInternals

    You could run these files from a Process, get the output, and parse the text.

    Author Closing Comment

    Thanks... I see many other items there that I could use as well.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    779 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

    17 Experts available now in Live!

    Get 1:1 Help Now