Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PowerPoint driven from Excel

0 views
Skip to first unread message

Mihai ZAMFIRESCU

unread,
May 5, 2006, 10:07:02 AM5/5/06
to
I want to create from Excel an PP Presentation, create some slides, import
OLE objects (Paste Special as Microsoft Office Excel Worksheet Object or
Picture WMF/EMF/DIB), and to scale the objects(shapes) without distorting'em)
Dim ppt As PowerPoint.Application, sld As PowerPoint.Slide, prs As
PowerPoint.Presentation
Range("A1:B3").Select
Selection.Copy
Set ppt = New PowerPoint.Application
ppt.Visible = True
Set prs = ppt.Presentations.Add(True)
prs.Slides.Add 1, ppLayoutBlank
Set sld = ppt.ActivePresentation.Slides(1)
prs.SaveAs "Sample"
prs.Slides.Add 1, ppLayoutBlank
sld.Name = "qq"
...

Additional questions:
How I can Open an Presentation using Open form?
How I can move to a specific slide and insert there the object wanted?
How I can check if it's already a file with that name (not to override it)?

I use Office 2003 SP2.

Thanks!

Steve Rindsberg

unread,
May 5, 2006, 1:37:56 PM5/5/06
to
In article <ED3CF96A-3AC1-4E29...@microsoft.com>, Mihai
ZAMFIRESCU wrote:
> I want to create from Excel an PP Presentation, create some slides, import
> OLE objects (Paste Special as Microsoft Office Excel Worksheet Object or
> Picture WMF/EMF/DIB), and to scale the objects(shapes) without distorting'em)
> Dim ppt As PowerPoint.Application, sld As PowerPoint.Slide, prs As
> PowerPoint.Presentation
> Range("A1:B3").Select
> Selection.Copy
> Set ppt = New PowerPoint.Application
> ppt.Visible = True
> Set prs = ppt.Presentations.Add(True)
> prs.Slides.Add 1, ppLayoutBlank
> Set sld = ppt.ActivePresentation.Slides(1)
> prs.SaveAs "Sample"
> prs.Slides.Add 1, ppLayoutBlank
> sld.Name = "qq"
> ....

>
> Additional questions:
> How I can Open an Presentation using Open form?
> How I can move to a specific slide and insert there the object wanted?

Dim lSlideIndex as Long
lSlideIndex = 2 ' or whatever slide you want to paste to
prs.Slides(lSlideIndex).Shapes.Paste

> How I can check if it's already a file with that name (not to override it)?

If Len(Dir$("Full Path to File")) > 0 Then
' the file exists
End If

>
> I use Office 2003 SP2.
>
> Thanks!
>

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================


0 new messages