PowerPoint driven from Excel

G

Guest

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!
 
S

Steve Rindsberg

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top