?
Solved

EXCEL OBJECTS FROM VISUAL BASIC

Posted on 2003-03-18
6
Medium Priority
?
156 Views
Last Modified: 2013-11-25
Hello Gurus,
I am refrencing Excel Object Library from my VB dll's.
Once in a blue moon I am seeing dangling Excel Objects, even though I think I am taking good care to close all the objects in regular and exception cases.
Is there a way to clean Excel objects from the task bar using Visual Basic ?
Please let me know.
Thanks.
0
Comment
Question by:vb_virgin
6 Comments
 

Author Comment

by:vb_virgin
ID: 8160490
Sorry .. I meant Task Manager and not Taskbar.
Thanks
0
 
LVL 1

Accepted Solution

by:
SpineyNorman earned 80 total points
ID: 8161203
Try something like this out

Dim xls As Excel.Application

On Error GoTo errCantCreate
Do
    Set xls = GetObject(, "Excel.Application")
    xls.Quit
    Set xls = Nothing
Loop
errCantCreate:
MsgBox "done"
End Sub
0
 
LVL 6

Expert Comment

by:DominicCronin
ID: 8161358
Indeed Spiney is right. It's a very annoying feature of Excel that if you don't call .quit, the application sticks around and messes up your life.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Expert Comment

by:SpineyNorman
ID: 8211864
vb_virgin,
Has this worked for you?
0
 

Expert Comment

by:CleanupPing
ID: 8532064
Hi vb_virgin,
This old question (QID 20554981) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
LVL 6

Expert Comment

by:DominicCronin
ID: 8536031
Recommend points to SpineyNorman
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question