0

I am attempting to connect python to excel, using VSCode, a pySide6 GUI and xlwings and win32com. Whilst I can manage to update an excel document when it is closed, I cannot seem to be able to do live updates with excel being open. The aim is to have an excel co-pilot style design, but every time I try and locate the file through my code with the excel file already open, I get the "this file is in use" error.

Is there any way to override this microsoft locking system, so that I can have both the copilot and excel document updating each other at the same time?

3
  • 5
    Talk to Excel through its API, not by reading files. As you have discovered, Excel acquires exclusive access to worksheets when it opens them. You can't override that; the protection wouldn't be very useful if programs could just override other programs' exclusive access willy-nilly, would it? Commented Jul 2 at 15:54
  • Python in excel may be a better solution, have you considered using that? If so, why doesn't it work for your application? support.microsoft.com/en-us/office/… Commented Jul 3 at 1:34
  • Sounds like a great way (if you could do it) to corrupt the spreadsheet Commented Jul 3 at 5:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.