Click here to Skip to main content
16,012,316 members

Comments by Member 9861478 (Top 47 by date)

Member 9861478 23-Feb-14 21:38pm View    
Thank you so much!!!
Member 9861478 2-Dec-13 4:22am View    
Your post is really valuable, I find more information in this link..Thank you so much
Member 9861478 9-Oct-13 11:59am View    
Sorry about that, sure.
Member 9861478 27-Sep-13 1:50am View    
Hi Ganesh. My senario is different already tried those before. I am able to export to excel successfully. I am looking for Password protected for the excel after exporting to excel.
Here is my code.

Protected Sub btnPayroll_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPayroll.Click
Response.Clear()
Response.AddHeader("content-disposition", "attachment; filename=Monthly Payroll.xls")
Response.Charset = ""
Response.ContentType = "application/vnd.xls"
Dim stringWrite As New System.IO.StringWriter()
Dim htmlWrite As System.Web.UI.HtmlTextWriter = New HtmlTextWriter(stringWrite)

Dim FilePathName As String = Request.PhysicalPath
Dim fileInfo = New IO.FileInfo(FilePathName)
fileInfo.IsReadOnly = True

GridView1.HeaderRow.Style.Add("background-color", "#99CCFF")


GridView1.RenderControl(htmlWrite)
Response.Write(stringWrite.ToString())
Response.[End]()
End Sub
Member 9861478 19-Sep-13 2:37am View    
Thank you for the answer. I am working on my local machine not yet in server when I posted. I just now checked in Server. Is there any property to apply Readonly to excel?