471,330 Members | 1,041 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

ManagementObject

S.D
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

Jul 21 '05 #1
1 2156
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
Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Brian Piscopo | last post: by
5 posts views Thread by David Clegg | last post: by
9 posts views Thread by scsharma | last post: by
1 post views Thread by S.D | last post: by
reply views Thread by wasishincar | last post: by
2 posts views Thread by DBC User | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.