473,396 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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

175 100+
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
2 16177
tifoso
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
manontheedge
175 100+
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

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

Similar topics

0
by: HAS | last post by:
Intermittently I am experiencing a problem where an excel file I open is opened read only because it claims to be locked. I have gone into task manager and killed all running Excel, I can open the...
2
by: Ryan Riddell | last post by:
I wrote an application to pull data from certain ranges of an Excel workbook. The application works great for the first 2 of 4 sections I created. I created the third section of code and the...
3
by: thebhone | last post by:
I am creating a website updater program. Currently working on the image replacement module here. For some reason, after an image (say /images/1.jpg) has been used/opened in the application. I...
0
by: jamesmkennedy | last post by:
I'm new to this community/forum, so please forgive me if I miss any normal question protocols. I have not programmed in Perl in a couple of years, and the programming I have done has been pretty...
3
by: Praveensb | last post by:
Hi, When i tried to parse the excel file using jexcel api i got an error saying that Cannot read drop down range Unrecognized token.Can anyone help me to sort out thes issue. Thanks in...
5
by: prasun | last post by:
hi guys... can anyone of u ans me how to read a microsoft excel file using c..... if possibel give the lines of code..
1
by: veeves | last post by:
I am using Access 2000 and 2002. I use Access only to create the database design. Then I move the MDB file to a server where an application connects to it using ASP.Net. Occasionally I will...
1
by: boss306 | last post by:
Unable to undo checkout .asp file locked by X:user Ms frontpage 2003 main index.asp file is checked out and locked for editting by a user in which is no longer with company. Could anyone point me...
1
by: Jason | last post by:
I am wanting to display an excel file on the web and allow it to be editable and be able to be saved online through the web. Any way to do this? thanks.
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.