ManagementObject

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, i am trying to find the user who locks the file (ms excel or word file )
in a shared folder. I have written the code but
wmiObject.GetRelated("Win32_Process") returns no process.

How can i find the user?

Thanks for your assistance

Dim mySelect As New SelectQuery("select * from cim_datafile Where name='" &
fileName & "'")
Dim myResults As New ManagementObjectSearcher(mySelect)
For Each wmiObject As ManagementObject In myResults.Get()
For Each myProcess As ManagementBaseObject In
wmiObject.GetRelated("Win32_Process")
myProcess.Dispose()
Next
Next
 
SD,

I have seen this question a lot of times before and never saw an answer.
However you say about an office file.

Maybe you can try it crossposted in one of these newsgroups.

microsoft.public.excel.programmers
microsoft.public.office.vba

I thougth that I had readed that Office had an extra mechanism.

I hope this helps?

Cor
 
Back
Top