VBA Excel - Power Point

  • Thread starter Thread starter Diego
  • Start date Start date
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
 
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
 
Thanks. However, I got an error "Object does not support
this property/method" in exapp.activate. Do you know why?
 
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?
 
Back
Top