Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Update Excel spreadsheet with Powerpoint Data | Excel Discussion (Misc queries) | |||
Hyperlink an excel spreadsheet to a specific Powerpoint slide | Excel Worksheet Functions | |||
Very Wide Spreadsheet | Excel Discussion (Misc queries) | |||
How to convert an excel spreadsheet into a Powerpoint page? | Excel Worksheet Functions | |||
Link from an Excel spreadsheet to a specific slide in PowerPoint | Excel Discussion (Misc queries) |