Hello lizhunji,
Excel 2007 does not read pure html like 2003-2005 versions I'm afraid, you have two options that I can think of right now and I'm certain many others.
You can write the gridview as an excel 2005 spreadsheet with the file extension xls and when you open that up in excel 2007 you get a warning message "The file you are trying to open 'FileName.xls' is in a different format than the 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?" That is one long A** message and very unprofessional, but! it works.
Or you can down the method of writing the file as a CSV and changing the extension to xlsx which is excel 2007, sure is annoying! But Microsoft wanted to downgrade functionality I'm afraid (Not hating Microsoft!)
I have no code for the CSV method as yet, but if you want to do the first method then your code is almost already there. Try adapt this.
Response.Clear()
Response.AddHeader("content-disposition", "attachment;filename=FileActivity" & "_" & Format(Date.Now, "dd/MM/yyyy_HHmm") & ".xls")
Response.Charset = ""
Response.ContentType = "application/vnd.xls"
Dim sw As System.IO.StringWriter = New System.IO.StringWriter
Dim hw As System.Web.UI.HtmlTextWriter = New HtmlTextWriter(sw)
grdActivity.RenderControl(hw)
Response.Write(sw.ToString)
Response.End()