Dynamicgra d
Dynamicgra d

Reputation: 1

FreezePanse generates Unable to set the FreezePanes property of the Window class during visible = False

I am trying to set FreezePanes on the first column in my Sheet using xlwings. As suggested by @Felix Zumstein in the thread below: How to freeze pane in XLWings

app: xw.App = xw.App(visible=True)

wb: xw.Book = app.books.add()
active_window = wb.app.api.ActiveWindow
active_window.FreezePanes = False
active_window.SplitColumn = 1
active_window.SplitRow = 0
active_window.FreezePanes = True

wb.save("test.xlsx")

When app property visible = True, it works fine. But when i set visible = False then The error below occurs:

pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft Excel', 'Unable to set the FreezePanes property of the Window class', 'xlmain11.chm', 0, -2146827284), None)

I use xlwings v 0.30.11

Upvotes: 0

Views: 48

Answers (0)

Related Questions