Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cut and Paste Wide Spreadsheet in Powerpoint, spreadsheet gets cut off

I have a wide spreadsheet that I need to paste into powerpoint from
excel. I have read about the limitations but thought this was fixed
in Office 2002. Below is my code any help would be greatly
appreciated.

'Launch Powerpoint
Set ppt = CreateObject("PowerPoint.Application")
'Make visible
ppt.Visible = msoTrue
'Insert New Presentation
Set pst = ppt.Presentations.Add
Set ppApp = GetObject(, "Powerpoint.Application.10")

' Reference active presentation
Set PPPres = ppApp.ActivePresentation

ppApp.ActiveWindow.ViewType = ppViewSlide

'-- some processing
Worksheets(ws.Name).Range(strRange).CopyPicture
Appearance:=xlScreen, _
Format:=xlBitmap

ppApp.ActivePresentation.Slides(iSlides).Shapes.Pa ste

ppApp.ActivePresentation.Slides(iSlides).Shapes.Ra nge.Top = 10
ppApp.ActivePresentation.Slides(iSlides).Shapes.Ra nge.Left = 10

ppApp.ActivePresentation.Slides(iSlides).Shapes.Ra nge.ScaleWidth
dScale, True
ppApp.ActivePresentation.Slides(iSlides).Shapes.Ra nge.ScaleHeight
dScale, True

ppApp.ActivePresentation.Slides(iSlides).Shapes.Ra nge.Align
msoAlignCenters, _
True
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Cut and Paste Wide Spreadsheet in Powerpoint, spreadsheet gets cut off

Hi Paul

Try function like this below . .

I am using a error handler coz sometimes it gives error on copypicture method and sometimes it works fine
so i am using resume to make it work

Sub PresentationExample(ByVal PPApp As PowerPoint.Application, ByVal PPPres As PowerPoint.Presentation, ByVal prmRange As Excel.Range
on error goto errhandle
Dim PPSlide As PowerPoint.Slid
Dim objRange As Excel.Rang
Set objRange = prmRang
Set PPSlide = PPPres.Slides.Add(PPPres.Slides.Count + 1, ppLayoutBlank
objRange.Selec
Application.CutCopyMode = False

objRange.CopyPicture Appearance:=xlScreen,
Format:=xlPictur

PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideInde
PPSlide.Shapes.PasteSpecial.Selec
PPPres.Slides(PPSlide.SlideIndex).Shapes(1).LockAs pectRatio = msoTru
Call PPPres.Slides(PPSlide.SlideIndex).Shapes(1).ScaleH eight(1, msoFalse, msoScaleFromTopLeft
Call PPPres.Slides(PPSlide.SlideIndex).Shapes(1).ScaleW idth(1, msoFalse, msoScaleFromTopLeft
PPPres.Slides(PPSlide.SlideIndex).Shapes(1).Width = 647.4
PPPres.Slides(PPSlide.SlideIndex).Shapes(1).Top =
PPPres.Slides(PPSlide.SlideIndex).Shapes(1).Left =
PPPres.Slides(PPSlide.SlideIndex).Shapes.Range.Ali gn msoAlignCenters, Tru
PPPres.Slides(PPSlide.SlideIndex).Shapes.Range.Ali gn msoAlignMiddles, Tru
Application.CutCopyMode = Fals
Set objRange = Nothin
errhandler:
Application.CutCopyMode = Fals
resum
End Su


Thanks
Kama

I have a wide spreadsheet that I need to paste into powerpoint fro
excel. I have read about the limitations but thought this was fixe
in Office 2002. Below is my code any help would be greatl
appreciated

'Launch Powerpoin
Set ppt = CreateObject("PowerPoint.Application"
'Make visibl
ppt.Visible = msoTru
'Insert New Presentatio
Set pst = ppt.Presentations.Ad
Set ppApp = GetObject(, "Powerpoint.Application.10"

' Reference active presentatio
Set PPPres = ppApp.ActivePresentatio

ppApp.ActiveWindow.ViewType = ppViewSlid

'-- some processing
Worksheets(ws.Name).Range(strRange).CopyPictur
Appearance:=xlScreen,
Format:=xlBitma

ppApp.ActivePresentation.Slides(iSlides).Shapes.Pa st

ppApp.ActivePresentation.Slides(iSlides).Shapes.Ra nge.Top = 1
ppApp.ActivePresentation.Slides(iSlides).Shapes.Ra nge.Left = 1

ppApp.ActivePresentation.Slides(iSlides).Shapes.Ra nge.ScaleWidt
dScale, Tru
ppApp.ActivePresentation.Slides(iSlides).Shapes.Ra nge.ScaleHeigh
dScale, Tru

ppApp.ActivePresentation.Slides(iSlides).Shapes.Ra nge.Alig
msoAlignCenters,
Tru

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Cut and Paste Wide Spreadsheet in Powerpoint, spreadsheet gets cut off

Hi Paul

Sometimes CopyPicture gives error and sometimes it works fine inspite of usin
Application.CutCopyMode = False which theratically clears the clipboard contents.so i have used resume
hope it helps
Take a look at the below func
Sub PasteRangeToPPT(ByVal PPApp As PowerPoint.Application, ByVal PPPres As PowerPoint.Presentation, ByVal prmRange As Excel.Range
On Error GoTo errhandle
Dim PPSlide As PowerPoint.Slid
Dim objRange As Excel.Rang
Set objRange = prmRang
Set PPSlide = PPPres.Slides.Add(PPPres.Slides.Count + 1, ppLayoutBlank
objRange.Selec
Application.CutCopyMode = Fals

objRange.CopyPicture Appearance:=xlScreen,
Format:=xlPictur


PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideInde

PPSlide.Shapes.PasteSpecial.Selec
PPPres.Slides(PPSlide.SlideIndex).Shapes(1).LockAs pectRatio = msoTru
Call PPPres.Slides(PPSlide.SlideIndex).Shapes(1).ScaleH eight(1, msoFalse, msoScaleFromTopLeft
Call PPPres.Slides(PPSlide.SlideIndex).Shapes(1).ScaleW idth(1, msoFalse, msoScaleFromTopLeft
PPPres.Slides(PPSlide.SlideIndex).Shapes(1).Width = 647.4
PPPres.Slides(PPSlide.SlideIndex).Shapes(1).Top =
PPPres.Slides(PPSlide.SlideIndex).Shapes(1).Left =
PPPres.Slides(PPSlide.SlideIndex).Shapes.Range.Ali gn msoAlignCenters, Tru
PPPres.Slides(PPSlide.SlideIndex).Shapes.Range.Ali gn msoAlignMiddles, Tru
Application.CutCopyMode = Fals
Set objRange = Nothin
Exit Su
errhandler
Application.CutCopyMode = Fals
Resum
End Su

Thanks
Kama
----- Paul DeSaro wrote: ----

I have a wide spreadsheet that I need to paste into powerpoint fro
excel. I have read about the limitations but thought this was fixe
in Office 2002. Below is my code any help would be greatl
appreciated

'Launch Powerpoin
Set ppt = CreateObject("PowerPoint.Application"
'Make visibl
ppt.Visible = msoTru
'Insert New Presentatio
Set pst = ppt.Presentations.Ad
Set ppApp = GetObject(, "Powerpoint.Application.10"

' Reference active presentatio
Set PPPres = ppApp.ActivePresentatio

ppApp.ActiveWindow.ViewType = ppViewSlid

'-- some processing
Worksheets(ws.Name).Range(strRange).CopyPictur
Appearance:=xlScreen,
Format:=xlBitma

ppApp.ActivePresentation.Slides(iSlides).Shapes.Pa st

ppApp.ActivePresentation.Slides(iSlides).Shapes.Ra nge.Top = 1
ppApp.ActivePresentation.Slides(iSlides).Shapes.Ra nge.Left = 1

ppApp.ActivePresentation.Slides(iSlides).Shapes.Ra nge.ScaleWidt
dScale, Tru
ppApp.ActivePresentation.Slides(iSlides).Shapes.Ra nge.ScaleHeigh
dScale, Tru

ppApp.ActivePresentation.Slides(iSlides).Shapes.Ra nge.Alig
msoAlignCenters,
Tru

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
Update Excel spreadsheet with Powerpoint Data Wi11y13 Excel Discussion (Misc queries) 1 September 14th 09 09:29 PM
Hyperlink an excel spreadsheet to a specific Powerpoint slide Maxine Excel Worksheet Functions 0 July 18th 08 04:01 PM
Very Wide Spreadsheet Kristine Excel Discussion (Misc queries) 1 December 19th 07 01:32 PM
How to convert an excel spreadsheet into a Powerpoint page? Sara Excel Worksheet Functions 1 January 12th 06 08:16 PM
Link from an Excel spreadsheet to a specific slide in PowerPoint VAB Charlie Excel Discussion (Misc queries) 1 February 22nd 05 10:31 PM


All times are GMT +1. The time now is 08:27 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"