Received error message which indicates that the respective file is already open.
Hi Experts,
I wrote the following code for downloading an excel file:
Select Case strFileType
           Case "txt" : Response.ContentType = "text/plain"
           Case "xls", "csv" : Response.ContentType = "application/x-msexcel"
           Case Else
               Response.ContentType = "application/octet-stream"
       End Select
Response.AddHeader("content-disposition", "inline; filename=" & ReportFileName) Response.TransmitFile(reportPhysPath & ReportFileName)
      Response.End()
The configuration is ASP.Net with VB.Net.
During the event strangely I received an error message. It indicates that the respective file is already open.
Have a look at the screenshot below.
Please help me to fix the problem.
Microsoft Office Excel
The file you are trying to open, 'Download.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is
from a trusted source before opening the file. Do you want to open the file now?
                                 Yes          No