473,804 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

175 New Member
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 16194
tifoso
41 New Member
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.Manageme nt
....

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

MyProcess.Kill( )
' more code
Next


Ciao
Apr 14 '07 #2
manontheedge
175 New Member
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
1345
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 xls file in excel and it lets me write and save it but when the app runs it thinks it is locked and opens read only. Even shutting down and restarting does not clear it. Using Office 10. Any thoughts on this? Thanks.
2
1659
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 code is correct; however, it isn't pulling the data. Below is a short / complete version of the page. I verified the problem is not in the code. I did this by copying the original file to a new file (copied all the cells, not the physical file)....
3
2829
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 cannot later overwrite it (during the application), even after i have closed it.
0
2708
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 basic and related to CGI. I work for a university and have been asked to create an HTML form that will collect data via Perl into a Microsoft Excel file. Periodically--maybe every week--they will download this file and import it into an internal...
3
4353
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 advance
5
1961
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
2454
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 create a circumstance where I get "file locked by another user". I figured out this happens when I overlook a case where the datareader does not get closed and the connection does get closed. The file then is locked and the only way to unlock it is to...
1
2048
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 in the right direction to unlock this file from old user so I can update the main index.asp file Regards: Eric
1
1337
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
9711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10595
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9169
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7633
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.