本文介绍了如何解决Missing Powerpoint 15对象库错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经编写了一个从excel导出到powerpoint的宏,并且已经在Excel / Powerpoint 2013 2010中正常工作。

I have written a macro that exports from excel to powerpoint and have gotten it to work properly in Excel/Powerpoint 2013, 2010.

但是我在另一个版本的Excel 2010,并有一个VBA错误,它缺少powerpoint对象库15.我尝试运行宏与powerpoint库14,并能够但它不是重新格式化幻灯片或做了很多我正在做的格式。

However I tested it on another version of Excel 2010 and got a VBA error that it was missing powerpoint object library 15. I tried running the macro with powerpoint library 14 and was able to but it wasn't reformatting the slides or doing a lot of the formatting that I was doing.

安装对象库的最佳方法/最简单的方法是什么?我可以从参考标签浏览和导入文件吗?如果是这样,我如何找到对象库的dl文件?我需要告诉一个客户,所以我想尽可能的简单。

What is the best way/easiest way to install an object library. Can I browse and import the file from the reference tab? If so how can I locate a dl file for the object library? I need to tell a client so i'm trying to make this as easy as possible.

注意我的代码如下。我很难将此更改为早期约束每个Adam的反馈如下。

Note My code is below. I am having a hard time changing this to early binding per adam's feedback below.

  Sub CopyDataToPPT()
'Const ppLayoutBlank = 12
Dim objWorkSheet As Worksheet
Dim objRange As Range
Dim objPPT As Object
Dim objPresentation As Object
Dim shapePPTOne As Object
Dim intLocation, intHeight, inLayout As Integer
Dim strRange As String
Dim boolOK As Boolean

Application.ScreenUpdating = False
'Set objWorkSheet = ThisWorkbook.ActiveSheet

Set objPPT = CreateObject("PowerPoint.Application")

objPPT.Visible = True
inLayout = 1

Set objPresentation = objPPT.Presentations.Add


    boolOK = False
        strRange = "p19:y48"  '<- here
        intHeight = 430
        boolOK = True

    If boolOK = True Then
        Set objslide = objPresentation.Slides.Add(1, inLayout)
        objPresentation.Slides(1).Layout = ppLayoutTitleOnly

        objPresentation.Slides(1).Shapes.Title.TextFrame.TextRange.Text = "Reebok- " & Sheets("Brand Personality").Cells(3, 2)

        Set objRange = Sheets("Brand Personality").Range(strRange)
        objRange.Copy

        DoEvents
        Set shapePPTOne = objslide.Shapes.PasteSpecial(DataType:=ppPasteEnhancedMetafile, Link:=msoFalse)


        shapePPTOne(1).Left = 220
        shapePPTOne(1).Top = 100
        shapePPTOne(1).Height = intHeight

        Application.CutCopyMode = False
    End If


推荐答案

图书馆本身不能安装。在这种情况下,更简单的方法是在代码中使用后期绑定,这应该删除库依赖。 是对早期和晚期绑定之间差异的一个很好的介绍。

The library can not be installed just by itself. The simpler way in this situation is to use late binding in your code which should remove the library dependency. Here is a good primer on the differences between early and late binding.

这篇关于如何解决Missing Powerpoint 15对象库错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 23:53