End Graph.exe process in powerpoint vba code

Hi,

I am modifying a graph with Powerpoint vba, each time I set the oGraphChart a new process of graph.exe begins, but when I clear my objects the process graph.exe remains in my task manager and each time I run my macro on another object another instance of graph.exe starts. How do I end the instance of graph.exe in my vba code?

Here is what I have tried but it does not end the process graph.exe


    Dim oGraphChart As Object
    Dim oDatasheet As Object
    Dim oSh As Shape

            Set oSh = ActiveWindow.Selection.ShapeRange(1)
            Set oGraphChart = oSh.OLEFormat.Object
            Set oDatasheet = oGraphChart.Application.datasheet
            With oDatasheet

.....

            end with

           
            Set oSh = Nothing
            Set oGraphChart = Nothing
            Set oDatasheet = Nothing
theomyshAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

irudykCommented:
After the End With add the line
            oGraphChart.Application.Quit
So, your code would be something like:
 

    Dim oGraphChart As Object
    Dim oDatasheet As Object
    Dim oSh As Shape

            Set oSh = ActiveWindow.Selection.ShapeRange(1)
            Set oGraphChart = oSh.OLEFormat.Object
            Set oDatasheet = oGraphChart.Application.datasheet
            With oDatasheet

.....

            end with

            
            oGraphChart.Application.Quit
            Set oDatasheet = Nothing
            Set oGraphChart = Nothing
            Set oSh = Nothing

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
theomyshAuthor Commented:
Thank you so much!!!!!
0
theomyshAuthor Commented:
I just noticed that my graphs do not update when I added oGraphChart.Application.Quit

Is there an update or save step I should be doing?
0
irudykCommented:
Hmm, I'm not sure why that would be the case since after updating values in the datasheet object results in my graph updating automatically.  I notice that in my code after:
     Set oSh = ActiveWindow.Selection.ShapeRange(1)
I have
     oSh.Activate
Maybe that would make a difference for you?
0
irudykCommented:
Also, maybe enter:
     oGraphChart.Application.Update
before the line
     oGraphChart.Application.Quit
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.