Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1255
  • Last Modified:

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.Name).Activate
End Sub
0
Bojerne
Asked:
Bojerne
3 Solutions
 
davidi1Commented:
@Bojerne -

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
0
 
BojerneAuthor Commented:
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
0
 
Swapnil NirmalManager, Audit AnalyticsCommented:
Below is the code as required by you

Private Sub Workbook_Open()
ActiveWindow.WindowState = xlMinimized
End Sub

Open in new window

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
BojerneAuthor Commented:
But won't that code just minimize the excel ?
0
 
Swapnil NirmalManager, Audit AnalyticsCommented:
no it will minimize ppt
0
 
Swapnil NirmalManager, Audit AnalyticsCommented:
or you may try this:

Private Sub Workbook_Open()
PowerPoint.Application.WindowState = ppWindowMinimized
End Sub

Open in new window


you need to add reference of powerpoint before using above code.
0
 
BojerneAuthor Commented:
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
0
 
BojerneAuthor Commented:
PowerPoint.Application.WindowState = ppWindowMinimized

also don't minimize the ppt and doesn't bring the xlsm in front  :) ?
0
 
BojerneAuthor Commented:
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
0
 
JSRWilsonCommented:
You can't minimise the show window the code will minimise the edit window.

Excel should open in front of PowerPoint but sometimes it doesn't and noone seems to know why.

You can change the size of the show window but make sure you can get it back to normal!
With SlideShowWindows(1)
.Width=150
.Height=100
.Left=0
.Top=0
End With
0
 
Swapnil NirmalManager, Audit AnalyticsCommented:
It may be wild but try this:

Instead to hyperlink to file, link it to macro code in Powerpoint
Sub Temp()
Shell "Explorer.exe c:\MyFile.xls", vbMaximizedFocus
End sub

Open in new window

0
 
BojerneAuthor Commented:
Hmm, I was hoping I could fix it from the Excel file, when it was opened - to spare me from editing the open code in a lot of ppt files :) - but I found that using the code below when opening the xls solved the focus issue

Set objXL = CreateObject("Excel.Application")
objXL.Application.Workbooks.Open strxlsFil
objXL.Application.screenupdating = False
Set objActiveWkb = objXL.Application.ActiveWorkbook
objXL.Visible = True
objXL.Application.screenupdating = True
objActiveWkb.SetFocus

Thank you for the inputs
0
 
BojerneAuthor Commented:
Thank you for leading me in the right direction
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now