<p>I've noticed that Internet Explorer adds a number in square brackets to files downloaded from the internet (usually [1]). This creates a big problem with downloading Excel spreadsheets as square brackets are not a valid filename character inside Excel worksheet name. That problem is IE specific, others browsers are keeping same file name.</p>

<p>So, if you have a pivot table auto-refreshed on file opening for example, you'll get an error message saying the name "file[1].yourPivotTableName" is not valid.</p>

<p>Is there any solution to that problem ?</p>

<p>EDIT : It seems that whatever the <strong>filename suggested by HTTP directives</strong>, IE adds [1] in all cases, which cause the problem ! (So, answers about filenames aren't helpful in that case)</p>

<p>EDIT : I've tried some VBA code to save file under another name when it'll open. However, it doesn't work (same error message than before). Do you think there's a way to fix that with VBA ?</p>

Actually, the correct .NET-code is as following:
```
```
Response.AppendHeader("content-disposition", "attachment;filename=file.xls");
Response.ContentType = "application/vnd.ms-excel";
```
```
Note:
AppendHeader
, not
AddHeader
, which I think only works in debug web-server and IIS7.