Disposing Excel Object
Disposing Excel Object
Disposing Excel Object
Disposing Excel Object
Disposing Excel Object
Disposing Excel Object Disposing Excel Object Disposing Excel Object Disposing Excel Object Disposing Excel Object Disposing Excel Object Disposing Excel Object Disposing Excel Object
Disposing Excel Object Disposing Excel Object
Disposing Excel Object
Go Back  Xtreme Visual Basic Talk > > > Disposing Excel Object


Reply
 
Thread Tools Display Modes
  #1  
Old 07-02-2014, 03:13 PM
jojo69 jojo69 is offline
Freshman
 
Join Date: Oct 2008
Posts: 30
Default Disposing Excel Object


Is this the correct way to release resources using Excel Object Model and VB.net

Code:
        oExcel.DisplayAlerts = False
        osheet = Nothing
        oBook.Close(True)
        oExcel.DisplayAlerts = True
        

        oExcel.Quit()
Reply With Quote
  #2  
Old 07-02-2014, 04:49 PM
Cerian Knight's Avatar
Cerian KnightDisposing Excel Object Cerian Knight is offline
Polymath (in disciplina)

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 4,199
Default

On the surface that seems basically correct... but there is more to the subject than meets the eye. I suggest having a look at this, if you haven't done so:
Automating Office Programs with VB.Net / COM Interop
__________________
I got all the answers wrong on the GLAT, apparently even #9 (where I put a period in the middle of the box and labeled it 'singularity ripe for rapid inflation').
Reply With Quote
Reply

Tags
dispose, jojo69


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Disposing Excel Object
Disposing Excel Object
Disposing Excel Object Disposing Excel Object
Disposing Excel Object
Disposing Excel Object
Disposing Excel Object Disposing Excel Object Disposing Excel Object Disposing Excel Object Disposing Excel Object Disposing Excel Object Disposing Excel Object
Disposing Excel Object
Disposing Excel Object
 
Disposing Excel Object
Disposing Excel Object
 
-->