Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 13th, 2010, 01:37 PM
Registered User
 
Join Date: Oct 2009
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default Problem with writing data to excel

Hi All,

I am writing data to Excel file using below code:


Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
xlWorkBook = New Excel.Application().Workbooks.Open("C:\Practice.xl s")
xlWorkSheet = xlWorkBook.ActiveSheet
xlWorkSheet.Cells(1, 1) = "Hello world"
xlWorkBook.Save()
xlWorkBook.Close()

I have included the Interop.Excel.dll and Interop dll as well in the bin folder.
and have added the Reference of "Microsoft Excel 11.0 object Library".
This code is working fine on the development machine. But on the server its giving below error error.


"Retrieving the COM class factory for component with CLSID failed due to the following error: 80040154.

Description: An unhandled exception occurred during the execution of the current web request.
Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException:
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046}
failed due to the following error: 80040154."

On the server microsoft office is not installed, so i m guessing if that is not causing the problem.

Can you please tell me how to resolve this problem. what is the trick.


Thanks
utyk
 
Old January 14th, 2010, 12:28 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Please check the following thread:
http://forums.asp.net/t/1303594.aspx
__________________
Om Prakash Pant
Click the "Thanks" button if this post helped you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem writing listview data to mysql db method Pro VB Databases 0 May 17th, 2006 06:18 AM
Reading and Writing data from Excel using VB? honey123 VB How-To 0 March 25th, 2006 08:48 AM
Writing Data to Excel from VB6 wildergoose Beginning VB 6 5 December 16th, 2004 07:27 AM
Writing Data to excel acdsky VB How-To 3 June 3rd, 2004 03:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.