-----------------------------------------------------------

New Message on MumbaiUserGroup

-----------------------------------------------------------
From: NitiN_in_GrouP
Message 2 in Discussion




  
    
    New Message on MumbaiUserGroup
  
  





      Closing Excel 2003 objects from ASP.NET

    
  
    
      Reply

          
            
                
               
                  Reply to Sender
                    Recommend
                  
                  Message 1 in Discussion
                                                
            
          
        
                    
        
            
              From: 
              NitiN_in_GrouP
            
            
              

              



Hi Friends,



I am using the following piece of code to write an Excel file through ASP.NET 
and VB.NET.



            Dim objxlsAppln as Object

            Dim objxlsWorkSheet as Object

            objxlsAppln = CreateObject("Excel.Application")

            
objxlsAppln.Workbooks.Open(Page.Server.MapPath("..\Reports\Template.xls"))

            objxlsWorkSheet = objxlsAppln.ActiveWorkbook.ActiveSheet

            .

            .

            .(Code to writing Excel File)

            .

            .

            'Code to save file and close excel object

            objxlsWorkSheet.SaveAs(Page.Server.MapPath("..\Reports\Report.xls"))

            objxlsAppln.ActiveWorkbook.Close()

            objxlsAppln.Quit()

            System.Runtime.InteropServices.Marshal.ReleaseComObject(objxlsAppln)

            
System.Runtime.InteropServices.Marshal.ReleaseComObject(objxlsWorkSheet)

            GC.Collect()

            GC.WaitForPendingFinalizers()

            objxlsWorkSheet = Nothing

            objxlsAppln = Nothing



My problem is even after the above code is executed the excel.exe process is 
not closed. This runs well in Excel prior to version 2003, but in Excel 2003 it 
is not closing the excel.exe process.



Please help.



Thanks,

Nitin


          
        
      
          
  

    View other groups in this category.
  

  

      




-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/mumbaiusergroup/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to