Try Response.HttpContext.Current.Response.Clear() Response.HttpContext.Current.Response.Charset = "" 'set the response mime type for excel Response.HttpContext.Current.Response.ContentType = "application/vnd.ms-excel" Response.HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=ExcelFileName.XLS") Dim stringWrite As new System.IO.StringWriter() Dim htmlWrite As new HtmlTextWriter(stringWrite) myDataGrid.RenderControl(htmlWrite) Response.Write(stringWrite.ToString()) Catch ex As Exception Response.Write("Error: " & ex.Message) End Try