Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 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 August 1st, 2006, 06:58 AM
Registered User
 
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error Creating Excel Object

Hi,
  I created a Excel object using interop.excel 9.0. the code is as simple as

protected Excel.ApplicationClass oExcel = null;
oExcel = new Excel.ApplicationClass();

Now this works well in my development environment but in production it's not working and throwing a 'Null reference Exception'. It's Obvious that it's an environment issue .

My questions are :

1.Does the Excel interop try to access something in important windows folders like 'System32' for which i don't have .. or in simple words can this be a disguised Access violation error?
2. if it's not a access violation erro then is there any way to get more details form this 'Null refernce exception' because i don't get a damn of what null reference is there ..

Can anyone help me out?



thanks @ regards
Deepak
 
Old August 1st, 2006, 07:32 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

If it was a permissions issue you would get an 'Access Denied' error as opposed to Null Reference.

Also, Microsoft does not recomened using Interop to access Excel as it was never designed to work this way, alternatively you may want to follow the examples on these pages:

http://SteveOrr.net/articles/ExcelExport.aspx
http://SteveOrr.net/articles/ExportPanel.aspx

Also if you do go about coding it the way you have done above, id suggest using Excel.Application as opposed to Excel.ApplicationClass. (The why's can be found on this MSDN blog)

http://blogs.msdn.com/ptorr/archive/.../05/67872.aspx

Hth.

"The one language all programmers understand is profanity."
 
Old August 2nd, 2006, 04:21 AM
Registered User
 
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks dparsons for Ur comments .. but i want to add more points

Ur link http://SteveOrr.net/articles/ExcelExport.aspx
showed me the way to create excel in many ways but as "steve" says all ways of creating excel won't suit everyone .. tht's what has happened to me ..
there are two methods which use the Response object to create excel but creating excel in that way pops up the mssg asking the client to save or open .. this is my problem because i want want to client to know that there is a excel that is getting created and i want all the stuff to be in the back ground :-(


And finally the Excel.Application also failed..
can U just suggest me a good way to derive meaningful error messages from this exception.. currently i log the error mssg in a text file but it's helping me no where

even the stack trace is not helping me .
and Ur suggestion for Application() instead of applicatioclass() .. here my point of argument is why use "Application" if it's in turn gonna use application class

thanks @ regards
Deepak





Similar Threads
Thread Thread Starter Forum Replies Last Post
converting .NET error object in VB error object webnet .NET Web Services 0 February 5th, 2007 06:02 AM
Excel object Error dpkbahuguna Beginning VB 6 7 August 2nd, 2006 03:14 PM
Error Occurred creating Report Object: Object does sa_moizatyahoo Classic ASP Professional 0 February 1st, 2005 10:29 AM
Error Creating an XMLDOM object sloynaz Classic ASP XML 7 May 11th, 2004 04:54 PM
error with creating graphics object Dinesh22 VB.NET 2002/2003 Basics 1 January 22nd, 2004 09:41 PM





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