VBA Excel - Power Point

D

Diego

I am creating a tool in Excel to copy data/graph from
Excel to PowerPoint.

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation

Set PPApp = CreateObject("PowerPoint.Application")
PPApp.Visible = True
Set PPPres = PPApp.Presentations.Open(ppt_file)
....

At the end of the code, I put:

ThisWorkbook.Activate
Msgbox("You have finished running the tool")

But it seems the screen still focuses in PowerPoint, so I
have to manually switch to Excel to see the msgbox. How do
I change the screen to the Excel file instead? Or, is it
possible to create the msgbox in PowerPoint instead?

Also, I put Application.ScreenUpdating = False in my code,
but it seems it onlhy works for Excel?


Thanks for the help
 
G

Guest

Diego,

this thisworkbook.activate only works inside excel it does not make the
excel application activate. try setting your excel application to a variable
and then activating that

dim Exapp as excel.application
set exapp = Excel.application
'all other code


exapp.activate

ben
 
D

Diego

Thanks. However, I got an error "Object does not support
this property/method" in exapp.activate. Do you know why?
 
G

Guest

diego,

it would appear i did not check the properties available for Excel, and
activate is not one of them. Try reinstating application.screenupdating =
true before the switch back to excel, or how about not letting power point
show at all?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top