Ya i used this code which u have pasted but it is not for multisheets of excel.Thats y i tried like this Dim obj_xl As New Excel.Application() Try obj_xl = GetObject(, "Excel.Application") Catch ex As Exception obj_xl = GetObject("", "Excel.Application") End Try obj_xl.Application.Visible = True obj_xl.Workbooks.Add() obj_xl.Sheets("Sheet1").Select() With obj_xl For i = 0 To dt.Rows.Count - 1 For j = 0 To dt.Columns.Count - 1 If IsDBNull(dt.Rows(i).Item(j)) Then .ActiveCell(i + 4, j + 1) = String.Empty Else .ActiveCell(i + 4, j + 1) = dt.Rows(i).Item(j) End If Next Next obj_xl.Dialogs(Excel.XlBuiltInDialog.xlDialogSaveAs).Show() End With This was the method i using to export values from data table. I used some COM components for excel This worked fine in my system.When i try to run in IIS its showing error as COM file missing
M
mullamootil
@mullamootil
Posts
-
Export Datagrid to Excel using ASP.Net -
Export Datagrid to Excel using ASP.NetI tried to export datagrid data to the excel. I got problem while exporting data to excel while working in IIS.It is showing COM file is missing.Please help me out Haripriya