A
A B
Hello,
I have the following two lines in my VB.NET code to cause a datagrid to
output in Excel format:
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("Content-disposition","attachment;filename=HubXLOut.xls")
When I click the "Open" dialog box and then Save As ->, the default file
type selected is HTML, not XLS. The file is appropriately named
HubXLOut.xls, however. If I do not change the dropdown to Microsoft
Excel before the save, my .NET application is unable to read this file
using OLEDB. Also, if I click "Save" on the initial dialog box, the
file is saved with an XLS extension, but OLEDB cannot read the file as
an Excel file. I don't want our customers to have to go through the
extra steps of Save As -> and then having to change the dropdown to
Excel. Any suggestions?
Thanks!
AB
I have the following two lines in my VB.NET code to cause a datagrid to
output in Excel format:
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("Content-disposition","attachment;filename=HubXLOut.xls")
When I click the "Open" dialog box and then Save As ->, the default file
type selected is HTML, not XLS. The file is appropriately named
HubXLOut.xls, however. If I do not change the dropdown to Microsoft
Excel before the save, my .NET application is unable to read this file
using OLEDB. Also, if I click "Save" on the initial dialog box, the
file is saved with an XLS extension, but OLEDB cannot read the file as
an Excel file. I don't want our customers to have to go through the
extra steps of Save As -> and then having to change the dropdown to
Excel. Any suggestions?
Thanks!
AB