0

By reading the last answer to the question: How to keep style format unchanged after writing data using OpenPyXL package in Python?

I see there is an XML file which contains metadata from Excel, including external links to other excelworkbooks. Thanks for such a good explanation.

After using load_workbook, when I get the cell value of a cell containing a formula with a reference to other workbook, that referred workbook file name is replaced by a sort of index ([2] / [3] in the example which follows):

=H8+E5+G7+'s1'!$E$5+[2]Sheet1!$D$1+[3]Sheet1!$D$5

I need to obtain that formula with the real workbookname (all the referred excel workbooks are in the same folder as the one I am handling), something like this:

=H8+E5+G7+'s1'!$E$5+'s2.xlsm'Sheet1!$D$1+'s1.xlsm'Sheet1!$D$5

I have seen the option keep links, but I don't manage to get those links to be part of the formula of the cell.

Is there a way to keep the real cell value with references to other workbooks when reading the cell in the origin workbook?

Thanks so much in advance.

Mesut Akcan
  • 899
  • 7
  • 19
coridefe
  • 11
  • 1
  • The code for managing external links does manage such references but you'll have to work out how to use it yourself. – Charlie Clark Feb 16 '20 at 11:35
  • Thanks for the information Charlie Clark. Do you mean that there is not any method/function already implemented and I will need to patch/modify the standard openpyxl source code? – coridefe Feb 18 '20 at 08:32

0 Answers0