Hi All,

I am getting following error :

[B]System.NullReferenceException: Object variable or With block variable not set.[/B]Source Error: 
Line 1266:              Error1.text=exp.tostring()
Line 1267:    
Line 1268:             oExcel.Quit()
Line 1269:             ReleaseComObject(oSheet)
Line 1270:    
Source File: F:\Web\airtel.net\newaudit\callwisereport.aspx    Line: 1268 


Stack Trace: 


[NullReferenceException: Object variable or With block variable not set.]
   Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn) +831
   Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) +23
   ASP.callwisereport_aspx.exportall_Click(Object sender, EventArgs e) in F:\Web\airtel.net\newaudit\callwisereport.aspx:1268
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1292

An early help would be appreciated
Thanks
Priya

When I removed try and catch block, I got the following error :

Cannot create ActiveX component. 
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.Exception: Cannot create ActiveX component.

Source Error: 


Line 219:          sheet=1
Line 220:          oExcel = Nothing
Line 221:          oExcel = CreateObject("Excel.Application")
Line 222:    
Line 223:            oBook = oExcel.Workbooks.Add
 

Source File: F:\Web\airtel.net\newaudit\callwisereport.aspx    Line: 221 

Stack Trace: 


[Exception: Cannot create ActiveX component.]
   Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String ServerName) +233
   ASP.callwisereport_aspx.exportall_Click(Object sender, EventArgs e) in F:\Web\airtel.net\newaudit\callwisereport.aspx:221
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1292

Please help me , I am a beginner in ASP.net and I have to resolve this problem today by all means.

Thanks
Priya


Priya

when am trying to read the excel sheet, it says Cannot Create Active x control, i havesearched and tried to configure DCOM settings, even then am not able to get thru the problem solved, can any body help me out, am using Microsoft Office 2000 with Windows XP,

This article has been dead for over six months. Start a new discussion instead.