ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   PivotTable problems downloaded into IE (https://www.excelbanter.com/excel-programming/372392-pivottable-problems-downloaded-into-ie.html)

[email protected]

PivotTable problems downloaded into IE
 
I have a Web application that lets users download Excel files. For
normal Excel files it works fine: you can open the XLS directly, or
save to disk and then open it. But if the report contains a PivotTable
based on a named range it chokes with "The PivotTable field name is not
valid" if you open the XLS from the Web link instead of first saving it
to the desktop or some other normal file location.

The problem appears to be with the way IE changes the filename in the
temp directory. I'm setting the Content-Disposition header to
attachment and specifying a filename, e.g. MyReport.xls. It ends up in
Content.IE5 under Temporary Internet Files as MyReport[1].xls. The
brackets in the filename appear to be what's causing problems with the
PivotTable; if you save the file without the brackets even in the same
directory it works.

This link:

http://groups.google.co.uk/group/mic...18a3ab143969cc

appears to suggest that after 2002 Excel started embedding the filename
as part of the named range reference used by the PivotTable for files
that appear to come from a dynamic source (e.g. a GET URL, which is the
case here) and in fact I can get another error (cannot open PivotTable
source file 'LoadReport?rptId=4506') if I don't set the headers to name
the file, similar to the problem described there.

I'm seeing this with Windows XP/Excel 2003/IE6.

What is the best workaround for this?



All times are GMT +1. The time now is 06:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com