I am trying to write a script that live edits an open excel file, but when I try to run the script that uses openpyxl and reads from a cell then writes data back to that cell with an edit, it gives this error PermissionError: [Errno 13] Permission denied: 'GameExcel.xlsx'
is there a way around this using another module, or is there a secret I am missing
Edit here's the code, also this is just me learning before I integrate it into the full code.
import openpyxl
from openpyxl import load_workbook
from openpyxl import workbook
from openpyxl.utils import get_column_letter
import os
import tkinter as tk
from tkinter import messagebox as tkMsgBox
import time
os.chdir("D:\Scripts\Python\Testing Scripts\My Excel Game")
wb = load_workbook("GameExcel.xlsx")
names = wb.sheetnames
sheet = wb['GameEnviroment']
#userInput = (input("what would you like it to say?"))
#print(userInput)
C3Val = sheet['C4'].value
sheet.cell(row=3, column=4).value = (C3Val + ' 4')
wb.save('GameExcel.xlsx')
print(C3Val + ' 3')
#sheet['A1']=userInput