+ Reply to Thread
Results 1 to 8 of 8

Activate Excel after opening PowerPoint from VBA Excel

Hybrid View

  1. #1
    Diego
    Guest

    Activate Excel after opening PowerPoint from VBA Excel


    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




  2. #2
    Fredrik Wahlgren
    Guest

    Re: Activate Excel after opening PowerPoint from VBA Excel


    "Diego" <porno_abis@hotmail.com> wrote in message
    news:015b01c52e5f$a4641380$a601280a@phx.gbl...
    >
    > 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




  3. #3
    Chip Pearson
    Guest

    Re: Activate Excel after opening PowerPoint from VBA Excel

    Try

    AppActivate Application.Caption


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




    "Diego" <porno_abis@hotmail.com> wrote in message
    news:015b01c52e5f$a4641380$a601280a@phx.gbl...
    >
    > 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
    >
    >
    >




  4. #4
    Diego
    Guest

    Re: Activate Excel after opening PowerPoint from VBA Excel


    Thanks Chip, it works. Could you explain a bit more on
    what the code actually does?


    >-----Original Message-----
    >Try
    >
    >AppActivate Application.Caption
    >
    >
    >--
    >Cordially,
    >Chip Pearson
    >Microsoft MVP - Excel
    >Pearson Software Consulting, LLC
    >www.cpearson.com
    >
    >
    >
    >
    >"Diego" <porno_abis@hotmail.com> wrote in message
    >news:015b01c52e5f$a4641380$a601280a@phx.gbl...
    >>
    >> 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
    >>
    >>
    >>

    >
    >
    >.
    >


  5. #5
    Chip Pearson
    Guest

    Re: Activate Excel after opening PowerPoint from VBA Excel

    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


    "Diego" <porno_abis@hotmail.com> wrote in message
    news:08dd01c52e65$b20fc640$a501280a@phx.gbl...
    >
    > Thanks Chip, it works. Could you explain a bit more on
    > what the code actually does?
    >
    >
    >>-----Original Message-----
    >>Try
    >>
    >>AppActivate Application.Caption
    >>
    >>
    >>--
    >>Cordially,
    >>Chip Pearson
    >>Microsoft MVP - Excel
    >>Pearson Software Consulting, LLC
    >>www.cpearson.com
    >>
    >>
    >>
    >>
    >>"Diego" <porno_abis@hotmail.com> wrote in message
    >>news:015b01c52e5f$a4641380$a601280a@phx.gbl...
    >>>
    >>> 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
    >>>
    >>>
    >>>

    >>
    >>
    >>.
    >>




  6. #6
    Diego
    Guest

    Re: Activate Excel after opening PowerPoint from VBA Excel


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


    >-----Original Message-----
    >Try
    >
    >AppActivate Application.Caption
    >
    >
    >--
    >Cordially,
    >Chip Pearson
    >Microsoft MVP - Excel
    >Pearson Software Consulting, LLC
    >www.cpearson.com
    >
    >
    >
    >
    >"Diego" <porno_abis@hotmail.com> wrote in message
    >news:015b01c52e5f$a4641380$a601280a@phx.gbl...
    >>
    >> 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
    >>
    >>
    >>

    >
    >
    >.
    >


  7. #7
    Chip Pearson
    Guest

    Re: Activate Excel after opening PowerPoint from VBA Excel

    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


    "Diego" <porno_abis@hotmail.com> wrote in message
    news:243c01c52e68$1366fc40$a401280a@phx.gbl...
    >
    > Would it be possible to do Application.ScreenUpdating =
    > False in PowerPoint called from VBA Excel?
    >
    >
    >>-----Original Message-----
    >>Try
    >>
    >>AppActivate Application.Caption
    >>
    >>
    >>--
    >>Cordially,
    >>Chip Pearson
    >>Microsoft MVP - Excel
    >>Pearson Software Consulting, LLC
    >>www.cpearson.com
    >>
    >>
    >>
    >>
    >>"Diego" <porno_abis@hotmail.com> wrote in message
    >>news:015b01c52e5f$a4641380$a601280a@phx.gbl...
    >>>
    >>> 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
    >>>
    >>>
    >>>

    >>
    >>
    >>.
    >>




  8. #8
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481

    AppActivate

    I am trying to use the AppActivate command as discussed here but it doesn't seem to be working.
    When I step through the code it brings Excel back to the focus.
    However if I run the code directly it does not seem to Activate Excel.
    Application.ScreenUpdating = True

    What may be causing this trouble?

    code using AppActivate

    Sub Save_File()
    Worksheets("bySamSoln").Select
    Cells(1, 1).Select
    ActiveWorkbook.Save
    Application.ScreenUpdating = True
    AppActivate ("Microsoft Excel")
    End Sub

    TIA

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1