`我目前使用以下 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 用于将我的数据粘贴到 power point 中呈现的图表中。最近我的桌面更新为 64 位,当我尝试运行我的 VBA 来生成我需要的电源点时,它给了我以下错误消息。运行时错误“-2147319779 (8002801d)”:自动化错误库未注册
我试图进一步调查可能导致此问题的原因,我认为这可能与命令“Set ppApp = New PowerPoint.Application”有关。
当我尝试只为 PasteImgtoPPT 运行宏时,我收到运行时错误“91”:对象变量或块变量未设置错误。
我已经尝试了数周来修复这个 VBA,但似乎找不到解决方案。任何帮助将不胜感激!
