By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 2,030 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

microsoft excel file locked for editing...how to unlock?

100+
P: 175
I have an issue with a file that is used by multiple people in multiple locations. It's an Excel file, and every now and then someone will forget to close out of it, and it will be inaccessible for hours. The message, "microsoft excel locked for editing" pops up when trying to open it, and you can either do a "read only" or "notify".

Is it possible to kick someone out of the file ( it's shared via intranet ), or somehow to take over the read/write control from whoever opened it first?

I'm asking in the VB forum because I figured the solution could use excel's VBA. Any help is appreciated.
Apr 13 '07 #1
Share this Question
Share on Google+
2 Replies


tifoso
P: 41
If the user running you "killer" app is on the Admin group you should be able write it up with API's calls, essentially you do what the task manager does and kill the proper proc.


Private Declare Function ProcessNext Lib "kernel32" Alias "Process32Next"(ByVal hSnapShot As Integer, ByRef uProcess As PROCESSENTRY32) As Integer
Private Declare Function ProcessNext Lib "kernel32" Alias "Process32Next"(ByVal hSnapShot As Integer, ByRef uProcess As PROCESSENTRY32) As Integer
'' and other ones you can find in the winapi set


In vb.net is a lot easier as sometimes hooking an API to the old vb6 or a vba is a bit of a tedious thingie

Imports System.Management
....

For Each MyProcess In Process.GetProcesses()
' some code
'look and kil for the ofedning proc

MyProcess.Kill()
' more code
Next


Ciao
Apr 14 '07 #2

100+
P: 175
I got it to work on my machine, but I still can't seem to get it to close a shared workbook, that someone else has open.
Apr 16 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.