Hello,
This is sangamesh, After adding the reference called "microsoft excel 11. object" for export to excel,
Imports System
Imports Microsoft.VisualBasic
Imports Mongoose.IDO.Protocol
Imports Mongoose.Scripting
Imports System.Runtime.InteropServices
Imports Microsoft.Office.Interop.Excel
Dim XlApp As New Microsoft.Office.Interop.Excel.Application
Dim xlbook As New Microsoft.Office.Interop.Excel.Workbook
Dim xlSheet As New Microsoft.Office.Interop.Excel.Worksheet
When i compile the program above 3 lines showing error. I installed microsoft office 2003 also.
Please help me out.
Loading

Lalit MRank #1,186 · 1.5K reputationPosted Dec 8, 2009, 7:00 PM EST
Srinivas KotraRank #8,059 · 229 reputationPosted Dec 14, 2009, 4:10 AM EST
paul daniel189 reputationPosted Jan 7, 2010, 3:01 AM EST
Try this code
Sub doExcel(Source as Object, E as EventArgs) If gv.Rows.Count.ToString + 1 < 65536 Then gv.AllowPaging="False" gv.DataBind Dim tw As New StringWriter() Dim hw As New System.Web.UI.HtmlTextWriter(tw) Dim frm As HtmlForm = new HtmlForm() Response.ContentType = "application/vnd.ms-excel" Response.AddHeader("content-disposition", "attachment;filename=" & txtFile.text & ".xls") Response.Charset = "" EnableViewState = False Controls.Add(frm) frm.Controls.Add(gv) frm.RenderControl(hw) Response.Write(tw.ToString()) Response.End() gv.AllowPaging="True" gv.Databind Else LblError.Text="Too many rows - Export to Excel not possible" End If End SubPaul daniel