export datagrid or datatable to excell

RTT

Member
Joined
Mar 18, 2005
Messages
19
Im using windows 2000 with excel 2000 SP3, i import the microsoft office 9.0 object library. But when i user your code i receive the error "System.Runtime.InteropServices.COMException (0x80028018): Old format or invalid type library." at those lines like:
Excel.Workbooks.Add()


also when i use code i find at
http://support.microsoft.com/kb/319180/EN-US/

http://support.microsoft.com/default.aspx?scid=kb;en-us;306022

seems like they al use 10.0 object library, but i only have the 9. isnt theire any simple solution to import my datatable or may datagrid to excel? i think i try almost everything. :s


does anybody has an idea or some code to create an excelfile from a datagrid of datatable....
 
As to exporting a datagrid to excel if using a win form have a look at the following thread

Thread

or for a bit more detail.
Link
Link

--------
If you are using a web form them do a search within this forum and you should be able to find your answer.
 
Back
Top