Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Export from Excel to Powerpoint

I have found different code to export a Range from Excel to PowerPoint. The
code I have is as follows:

Sub RangeToPresentation()
' Set a VBE reference to Microsoft PowerPoint Object Library

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide

' Make sure a range is selected
If Not TypeName(Selection) = "Range" Then
MsgBox "Please select a worksheet range and try again.", vbExclamation, _
"No Range Selected"
Else
' Reference existing instance of PowerPoint
On Error Resume Next
Set PPApp = GetObject(, "Powerpoint.Application")

' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide

' Reference new instance of PowerPoint
If Err.Number < 0 Then
'Err.Number 0 if no PP application is active or running. Then I will have
to create one instance:
Set PPApp = CreateObject("Powerpoint.Application")

Set PPPres = PPApp.Presentations.Add

'Add a slide
PPPres.Slides.Add 1, ppLayoutBlank

PPApp.Visible = True
'Activate PowerPoint
AppActivate PPApp.Name
End If
On Error GoTo 0

' Reference active slide
Set PPSlide =
PPPres.Slides(PPApp.ActiveWindow.Selection.SlideRa nge.SlideIndex)

' Copy the Excel range as a picture
Selection.Copy
'Selection.CopyPicture Appearance:=xlScreen, _
Format:=xlPicture DOES NOT DO THE TRICK WITH BIG PICTURES SO I NEED
TO COPY NORMALLY ....

' .. AND PASTE AS A PCITURE!
' Paste the range
PPSlide.Shapes.PasteSpecial DataType:=ppPasteMetafilePicture

'Now I want to select the pasted Range. BUT HOW?
ActiveWindow.Selection.SlideRange.Shapes(1).Select

'Now I want to add a new PP slide and activate that slide to paste another
range: BUT HOW?

'END MACRO

Any help appreciated!!

Martin
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Export from Excel to Powerpoint

Hi Martin,

I have found different code to export a Range from Excel to PowerPoint. The
code I have is as follows:


You might have a quicker response by posting in the PowerPoint newsgroups.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Export from Excel to Powerpoint

Just to make sure not to cross post, but OK, I´ll check out the other
PowerPoint pages!

Martin

"Stephen Bullen" wrote:

Hi Martin,

I have found different code to export a Range from Excel to PowerPoint. The
code I have is as follows:


You might have a quicker response by posting in the PowerPoint newsgroups.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export Excel tuncating leading zeros while export to excel from da RHBKV Setting up and Configuration of Excel 1 July 15th 09 01:48 PM
export re-order input fields to export file [csv] madisonpete Excel Worksheet Functions 0 November 30th 07 03:51 PM
how do i create a macro to export a chart to powerpoint? NPAT Charts and Charting in Excel 1 November 16th 07 10:23 AM
How to export all chartobjects in a sheet to powerpoint (creating a new ppt file) as pictures? Gunnar Johansson Charts and Charting in Excel 1 May 9th 05 05:10 AM
How to export a picture or chart from Excel to PowerPoint? RADO[_3_] Excel Programming 2 November 3rd 03 01:15 PM


All times are GMT +1. The time now is 06:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"