IE8 excel download invalidates chart data series references to named ranges
-
01-06-2021 - |
Pregunta
To recreate this problem:
Create an Excel workbook (.xlsx). I'm using Excel 2010, but I'm not sure that matters.
Create a named range.
Create a chart that refers to the named range for its data series values. The reference should look something like "workbook.xlsx!NamedRangeName".
Use IE8 to download this file from a web server. Open in Excel (without saving first).
When you try to open the file, Excel complains about invalid references, because somehow "workbook.xlsx" has been replaced with "http://someUrl/filename.xlsx" in the reference to the named range.
The problem does not occur if you save the file first instead of opening it. It does not occur in IE9 or Firefox either.
I suspect this is related to how IE stores downloaded files.
I'm looking for a workaround, since I assume only Microsoft could actually fix it. I can only control the server side, not the PC, browser configuration, or user behavior. I can change the excel files to some extent, but I do need the charts to refer to named ranges.
Solución
The workaround I found was to add to the download page:
<!--[if lte IE 8 ]>
<meta name="DownloadOptions" content="noopen" />
<![endif]-->
This removes the option for the user to open the file without saving it first.