Consulting

Results 1 to 4 of 4

Thread: PowerPoint Slide Selection in VBA

  1. #1
    VBAX Newbie
    Joined
    Oct 2006
    Posts
    1
    Location

    PowerPoint Slide Selection in VBA

    Hi All

    My company has recently upgrade our hardware and we now have SP2 for Office. I have a macro in Excel that creates PowerPoint slides from a template using data in the Excel file. When the code adds a slide now it automatically selects the first slide in the deck, which does not have a chart just a title, and then tries to paste the data in to the non-existant chart!

    Regardless of how explicit I make the slide to be selected the code selects the first slide. Unless I debug the code and step through it in which case it manages to select the last slide in the deck! Grrrrr!

    Many thanks for you time.

    Rupert

  2. #2
    Hi Rupert.
    In powerpoint itself, its
    [VBA]ActivePesentation.Slides(n).Shapes(n)[/VBA]
    if you want to select shapes.
    I don't know from excel but activepresentation.slides(n) may work.
    cheers

  3. #3
    MS Excel MVP VBAX Tutor
    Joined
    Mar 2005
    Posts
    246
    Location
    Quote Originally Posted by RedRoo
    When the code adds a slide now it automatically selects the first slide in the deck, which does not have a chart just a title, and then tries to paste the data in to the non-existant chart!

    Regardless of how explicit I make the slide to be selected the code selects the first slide. Unless I debug the code and step through it in which case it manages to select the last slide in the deck!
    Hard to tell what's up without seeing the code.
    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Peltier Technical Services
    Tutorials and Custom Solutions
    http://PeltierTech.com
    _______

  4. #4
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Quote Originally Posted by JonPeltier
    Hard to tell what's up without seeing the code.
    Agreed. Also would be nice to know what version you applied SP2 to. I'm assuming Office 2003?
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





Posting Permissions

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