2

I have an excel workbook I need to open from python in a writable mode. The workbook is set up to have the prompt for a read only recommendation and this cannot be removed.

I am using the following:

import win32com.client
xl=win32com.client.Dispatch("Excel.Application")
filepath = 'C:\Users\FullFilePath.xlsm'
xl.Workbooks.Open(Filename=filepath, ReadOnly=False, IgnoreReadOnlyRecommended=True)

It opens the file, but it's still popping up the dialog asking if I want to open in read only. Is it possible to cancel that dialog?

J Baretsky
  • 23
  • 5

1 Answers1

0

Use instead:

xl = win32com.client.DispatchEx('Excel.Application')

This works without a dialog box for me.

mechanical_meat
  • 163,903
  • 24
  • 228
  • 223