Mik Mak
asked on
Move focus away from Powerpoint in Show mode
We have an Excel file that gets opened from Powerpoint (thats running in Show mode) - but we cannot make it open in front of the Powerpoint - we've tried with the code below. Any ideas ? (maybe some help to minimize the powerpoint from when Workbook_Open is run, and then maximize Powerpoint when Workbook_Close is run - but I don't know how to code this :)
Private Sub Workbook_Open()
AppActivate "Microsoft Excel"
Windows(ActiveWorkbook.Nam e).Activat e
End Sub
Private Sub Workbook_Open()
AppActivate "Microsoft Excel"
Windows(ActiveWorkbook.Nam
End Sub
ASKER
Hi David
Thank you for the fast response. I know how to open the excel from powerpoint :) - but when powerpoint is run in Show mode it tends to remain infornt/in forcus - so some of our users don't notice that Excel has been opened because it's opened "behind" the Powerpoint pres.
So I was hoping someone could help me with some code that can run in the excel event "Workbook_Open", that minimizes the powerpoint on and brings the excel workbook itself in focus.
Thank you
Michael
Thank you for the fast response. I know how to open the excel from powerpoint :) - but when powerpoint is run in Show mode it tends to remain infornt/in forcus - so some of our users don't notice that Excel has been opened because it's opened "behind" the Powerpoint pres.
So I was hoping someone could help me with some code that can run in the excel event "Workbook_Open", that minimizes the powerpoint on and brings the excel workbook itself in focus.
Thank you
Michael
Below is the code as required by you
Private Sub Workbook_Open()
ActiveWindow.WindowState = xlMinimized
End Sub
ASKER
But won't that code just minimize the excel ?
no it will minimize ppt
or you may try this:
you need to add reference of powerpoint before using above code.
Private Sub Workbook_Open()
PowerPoint.Application.WindowState = ppWindowMinimized
End Sub
you need to add reference of powerpoint before using above code.
ASKER
I've just tested it, and it still opens in the background, but now with the Workbook minimized... :) See attached. I'm running Off 2010
Minimized.jpg
Minimized.jpg
ASKER
PowerPoint.Application.Win dowState = ppWindowMinimized
also don't minimize the ppt and doesn't bring the xlsm in front :) ?
also don't minimize the ppt and doesn't bring the xlsm in front :) ?
ASKER
Just removed an On error, and now I can see I'm getting an error when trying to run the line you suggested - but can't see why ? Please see attached
Open-error.jpg
Open-error.jpg
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you for leading me in the right direction
what i understand from your question is.., you're opening an excel file from powerpoint show. when clicked, u want the excel to be in front of powerpoint show..,
i'd say:
Use Insert, Hyperlink, then point to the Excel workbook you want displayed. When you close Excel, you automatically return to the PowerPoint slide containing the hyperlink.
Thanks,
David