I have created a simple Python script to edit an Excel file using the openpyxl package. I have the same Excel file connected as a data source in Microsoft Power Apps. After I edit the Excel table using the Python script, and try to edit the file from the Power Apps Edit form feature, I get the following error:
PowerApps Error "The requested operation is invalid. Server Response: Table1 failed: Failed to read the Excel workbook content. Failure reason: Error in implicit conversion. Cannot convert null object"
Is it possible that there is an edit conflict on the Excel file after writing to it with openpyxl? Or does the openpyxl save feature make the file/table null?
I am building this for RFID applications and I need to be able to write to the database continuously from Python while also accessing it via Power Apps. Any help is appreciated. I'm including my Python code below too. Thanks!
from openpyxl import load_workbook
filename = "rfid_test1.xlsx"
wb = load_workbook(filename)
ws = wb.worksheets[0]
ws_tables = []
for col in ws.iter_cols(max_col=1):
for cell in col:
if cell.value == "test":
print(cell.row)
ws.cell(row = cell.row, column = 8).value = "high"
ws.cell(row = cell.row, column = 9).value = "Video Lab"
ws.cell(row = cell.row, column = 10).value = "4:44PM"
wb.save(filename)