PDA

View Full Version : PowerPoint Slide Selection in VBA



RedRoo
10-26-2006, 04:51 AM
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

peterwmartin
12-22-2006, 08:16 AM
Hi Rupert.
In powerpoint itself, its
ActivePesentation.Slides(n).Shapes(n)
if you want to select shapes.
I don't know from excel but activepresentation.slides(n) may work.
cheers

JonPeltier
12-29-2006, 10:46 AM
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.

Ken Puls
12-29-2006, 03:39 PM
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?