Activate Excel after opening PowerPoint from VBA Excel

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
 
F

Fredrik Wahlgren

Diego said:
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

Try this
Application.ActiveWindow.Activate

/Fredrik
 
D

Diego

Would it be possible to do Application.ScreenUpdating =
False in PowerPoint called from VBA Excel?
 
C

Chip Pearson

The code simply brings to the foreground and activates the
application with the specified window text or caption.
Application.Caption returns that text.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
C

Chip Pearson

The PowerPoint Application object doesn't have a ScreenUpdating
property. It does have a Visible property, which you could set to
False if you don't actually need to see the PowerPoint
application.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

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