PowerPoint从Excel中复制图表时崩溃
对不起我的英语不好 :-)
我有以下问题:当从Excel文件复制图表到演示文稿时,PowerPoint突然崩溃。 其中一位与我交谈的人表示,问题出在了方法上,尽pipe我不确定。 而且我在互联网上找不到任何解决scheme。
函数我用来粘贴graphics:
Function CopyGraphs(CurrentSlidePosition As Integer, CurrentWorkbook As Workbook, newPowerPoint As PowerPoint.Application) As Integer Dim CurrentSheet As Worksheet For Each CurrentSheet In CurrentWorkbook.Worksheets CurrentSlidePosition = CurrentSlidePosition + 1 newPowerPoint.ActivePresentation.Slides(1).Duplicate newPowerPoint.ActivePresentation.Slides(2).MoveTo toPos:=CurrentSlidePosition CurrentSheet.ChartObjects(1).Copy newPowerPoint.ActiveWindow.View.GotoSlide CurrentSlidePosition newPowerPoint.ActivePresentation.Slides(CurrentSlidePosition).Select newPowerPoint.ActivePresentation.Slides(CurrentSlidePosition).Shapes("Graph").Select newPowerPoint.ActivePresentation.Windows(1).View.Paste newPowerPoint.ActivePresentation.Slides(CurrentSlidePosition).Shapes("Title").TextFrame.TextRange.Text = "Some text" Next CopyGraphs = CurrentSlidePosition End Function
这里是档案与档案:http://yadi.sk/d/Sx38T0dKMGNoN要执行它,你需要打开Macro.xlsm,并单击工作表上唯一的button:-) PP崩溃只在Windows上。 它在Mac上正常工作。
提前致谢!
我已经解决了崩溃问题的变化
<SLIDE>.Select <VIEW>.Paste
至
<SLIDE>.Shapes.Paste