Hi If you still have this problem
http://blog.crowe.co.nz/archive/2006/03/02/589.aspx
On Aug 30, 2:02 am, Maddy <[EMAIL PROTECTED]> wrote:
> Dear friends,
>
> i gotta problem in genrating report in excel sheet My code is as follows :
>
> Excel.Application xlApp = new Excel.Application();
>
> xlApp.Visible = true;
>
> //Excel.Workbook xlWorkBook = new Workbook();
>
> Excel.Workbook xlWorkBook = xlApp.Workbooks.Add(Missing.Value);
>
> Excel.Worksheet xlWorkSheet = new Worksheet();
>
> xlWorkBook = new Excel.Application().Workbooks.Add(Missing.Value);
>
> xlWorkBook.Application.Visible = true;
>
> // xlWorkSheet =(Excel.Worksheet) xlWorkBook.ActiveSheet;
>
> xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets[1];
>
> string getstr = "select * from budcat_master where cat_id like '" + val +
> "'";
>
> DataSet ds = ICPDDal.GetData(getstr);
>
> int i = 2;
>
> xlWorkSheet.Cells[1, 1] = "Category ID";
>
> xlWorkSheet.Cells[1, 2] = "Category Name";
>
> xlWorkSheet.Cells[1, 3] = "Categroy Description";
>
> xlWorkSheet.get_Range("A1","E1").Font.ColorIndex = Excel.Constants.xlColor1;
>
> xlWorkSheet.get_Range("A1", "E1").Font.Bold = true;
>
> foreach (DataRow dr in ds.Tables[0].Rows)
>
> {
>
> xlWorkSheet.Cells[i, 1] = dr[0];
>
> xlWorkSheet.Cells[i, 2] = dr[1];
>
> xlWorkSheet.Cells[i, 3] = dr[2];
>
> i++;
>
> }
>
> xlWorkSheet.Columns.AutoFit();
> the problem is in runtime.... i got a error like
> *Retrieving the COM class factory for component with CLSID
> {00024500-0000-0000-C000-000000000046} failed due to the following error:
> 80040154.*
> i am cluless !!!! please help me get rid of this error
> --
> Sarvesh
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---