Excel VBA库未注册运行时错误'-2147319779(8002801d)和#x27;

Excel VBA库未注册运行时错误'-2147319779(8002801d)和#x27;,excel,vba,Excel,Vba,`我目前使用以下VBA创建季度报告 'Dim ppApp As PowerPoint.Application Dim ppSlide As PowerPoint.Slide Dim shp As Object Dim myTextBox As Object Dim PPTTitle As String Dim PPTFooter As String Dim i As Integer Dim q As Integer Dim ChrtstoCopy As Integer D

`我目前使用以下VBA创建季度报告

'Dim ppApp As PowerPoint.Application   
 Dim ppSlide As PowerPoint.Slide
 Dim shp As Object
 Dim myTextBox As Object
 Dim PPTTitle As String
 Dim PPTFooter As String
 Dim i As Integer
 Dim q As Integer
 Dim ChrtstoCopy As Integer
 Dim TblstoCopy As Integer
 Dim Firstslide As Boolean
 Dim CurrentSite As String
 Dim shortDeptName As String
 Sub CopytoPPT(Lbox_Exp, Lbox_Lis, Lbox_Rec)

 'ACTIVATED BY: Userform2 Command Button
 'PURPOSE: Copy the printareas for slides 1-5 in picture format and then 
  paste to a PPT slide.

 'Identify the criteria for the PPT slides
  CurrentSite = UserForm2.SiteTbox.Value
  ChrtstoCopy = Slide1_Sht.Range("S19").Value - 1
  TblstoCopy = Slide5_Sht.Range("D5").Value
  Firstslide = True
  If UserForm2.CheckBox1 = True Then
  blinded = " (Blinded)"
  Else
  blinded = " (Unblinded)"
  End If

 shortDeptName = 
 TgtSht.Range("SaveFileName").Find(What:=CurrentSite).Offset(0, 1).Text
 fileNameString = TgtSht.Range("SaveFolder") & TgtSht.Range("SavePrefix") & 
  " - " & shortDeptName

  'Open PPT application and existing blank PPT template file
   Set ppApp = New PowerPoint.Application
   ppApp.Visible = True 
VBA用于将我的数据粘贴到电源点中显示的图形中。最近,我的桌面更新为64位,当我尝试运行VBA以生成所需的电源点时,它会显示以下错误消息。 运行时错误'-2147319779(8002801d)': 自动化误差 图书馆未注册

我试图进一步调查可能导致这种情况的原因,我相信这可能与命令“Set ppApp=New PowerPoint.Application”有关

当我尝试运行PasteImgtoPPT的宏时,我得到一个 运行时错误“91”: 对象变量或带块变量未设置错误


我已经尝试了几个星期来修复这个VBA,但似乎找不到解决方案。任何帮助都将不胜感激

项目中很可能没有
Microsoft Powerpoint
引用,因此尝试声明引用Powerpoint的变量将失败(您的项目不知道这是什么)

要告诉您的项目(制作参考资料),请转到工具>>参考资料并在列表中找到:

选中它,然后单击“确定”,然后再次尝试执行VBA

你也可以考虑晚绑定你的PowerPoint变量,这样你就不必引用它们:

 Dim ppApp As Object  
 Dim ppSlide As Object
 Set PPApp = CreateObject("PowerPoint.Application")
 Set ppSlide = PPApp.Slide

CreateObject
在运行时加载对
Powerpoint.Application
的引用。

您可以用实际代码而不是屏幕截图来回答问题吗?还可以将错误消息作为文本,而不是屏幕截图。为了获得快速、有效的帮助,您可能需要花点时间阅读有关在站点中询问堆栈溢出问题的内容……打开“工具->引用”对话框。有32位的吗?请停止重新添加代码段标记。这是Java\Html和类似的。