Sharing violation issue

mskli

New Member
Joined
Feb 20, 2017
Messages
40
Hello:

I recently got someone to write a python program that creates an application. Part of the application is to open an Excel with a particular spreadsheet. This all works fine - however when I go to make manual changes to the spreadsheet and save it I get a "your changes could not be saved to TestMD.xlsx because of a sharing violation. Try saving a different file" what does this mean? (If I close the application that brought up Excel then I can save it)
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
This is a notification from Windows, which is passed back to your application, that you are trying to use one process to write a file that is locked by another process. How does your Python code open Excel? I am not a Python programmer but I have written in several languages professionally so I can probably suss it out.

One possibility, but I have never done what you are doing, is that the Python runtime locks the Excel file, and so Excel itself cannot save the file. But I can't be sure without at least seeing your code, and possibly trying to run it. What Python environment are you using?
 
Upvote 0

Forum statistics

Threads
1,226,112
Messages
6,189,039
Members
453,521
Latest member
Chris_Hed

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top