- Remove From My Forums
-
Question
-
Hello,
I have one code given to me which working from Excel and sends mails with referenced Microsoft Outlook Object
Library and Microsoft Outlook View Control . It was working fine for all But i am getting error reading the first line of code.Set OutlookApp = New Outlook.Application
and when click on RUN below popup as an error:
Microsoft Visual Basic Run Time Error 2147319779 (8002801d)
I have gone through few forums and they suggested to run «RegSvr32 ScrRun.dll» from command prompt using admin account, i have tried but there another message coming which says
«The module «ScrRun.dll» was loaded but the call to DllRegisterServer failed with
error code 0x80004005″ For More Information about this problem, search online using the error code as a search term.I have «Windows 7 Professional SP1»
I have followed the below and related article for help but there is no go, Please Help
http://social.msdn.microsoft.com/Forums/en-US/b7d1a35f-3759-4217-91ba-e4416ac19d78/how-do-you-fix-error-code-0x80004005
Kindly suggest, what all steps needs to be perform?
Regards,
Raman Katoch
-
Moved by
Thursday, June 5, 2014 1:47 PM
Move to more appropriate forum
-
Moved by
Answers
-
ScrRun.dll is the library for VBScript. It’s not directly related to Outlook or Excel VBA code. What runs in both Excel and the Outlook session is VBA code.
The error you got was for an unregistered library. But the line that causes the error is where you instantiate an Outlook.Application object.
Do you have Outlook installed? Does it run OK?
In Excel if you create a new procedure like this:
Sub TestOL
Dim ol As Outlook.Application
Set ol = CreateObjecdt(«Outlook.Application»)
End Sub
Do you get any errors when you run that macro?
Ken Slovak MVP — Outlook
-
Marked as answer by
Raman Katoch
Friday, June 6, 2014 12:30 PM
-
Marked as answer by
-
If Outlook and Excel are from different versions there may be problems with automation. However, all indications based on the error messages are that there’s a corrupt installation that needs to be repaired.
See if that code snippet I provided works or not.
Ken Slovak MVP — Outlook
-
Proposed as answer by
jrv
Friday, June 6, 2014 1:41 PM -
Marked as answer by
Raman Katoch
Friday, June 6, 2014 4:53 PM
-
Proposed as answer by
We’ve have discovered that when running Office 2010 (32-bit) with Lync 2013 (32-bit) that VBA code will give the error:
Run-time error -2147319779 (8002801d):
Automation Error
Library not registered.
when code is used to control PowerPoint.
We found that the following registry key:
[HKEY_CLASSES_ROOTTypeLib{91493440-5A91-11CF-8700-00AA0060263B}2.b]
«PrimaryInteropAssemblyName»=»Microsoft.Office.Interop.PowerPoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C»
is created by the Lync 2013 installer (and some subsequent patches). But PowerPoint v15 (i.e. PowerPoint 2013) does not exist on the PCs, only PowerPoint 2010 is installed. (Other registry keys may be created that affect other components, but we’ve been concerned
only with PowerPoint).
The Office v14 (i.e. Office 2010) equivalent registry keys have much more information:
[HKEY_CLASSES_ROOTTypeLib{91493440-5A91-11CF-8700-00AA0060263B}2.a]
«PrimaryInteropAssemblyName»=»Microsoft.Office.Interop.PowerPoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C»
@=»Microsoft PowerPoint 14.0 Object Library»
[HKEY_CLASSES_ROOTTypeLib{91493440-5A91-11CF-8700-00AA0060263B}2.a]
[HKEY_CLASSES_ROOTTypeLib{91493440-5A91-11CF-8700-00AA0060263B}2.awin32]
@=»C:\Program Files (x86)\Microsoft Office\Office14\MSPPT.OLB»
[HKEY_CLASSES_ROOTTypeLib{91493440-5A91-11CF-8700-00AA0060263B}2.aFLAGS]
@=»0″
[HKEY_CLASSES_ROOTTypeLib{91493440-5A91-11CF-8700-00AA0060263B}2.aHELPDIR]
@=»[{91493440-5A91-11CF-8700-00AA0060263B}]»
It seems that the Lync 2013 installer is erroneously adding the «2.b» key assuming that PowerPoint 2013 is installed. I discovered the following the patches also add the «2.b» key on PCs with Lync 2013 and Office 2010 installed:
- KB3039779 : MS15-044: Description of the security update for Lync 2013 (Skype for Business): May 12, 2015 — [3039779]
- KB2986244 : May 12, 2015, update for OneDrive for Business (KB2986244)
- KB2986246 : May 12, 2015, update for Project 2013 (KB2986246)
- KB2880487 : April 14, 2015 update for Office 2013 (KB2880487)
- KB2965277 : May 12, 2015, update for Office 2013 (KB2965277)
- KB2975901 : May 12, 2015, update for OneNote 2013 (KB2975901)
However about 16 or so other Office 2013 patches that get applied to these Office 2010 with Lync 2013 PCs do not add the «2.b» registry key e.g. KB3039799 — Update for Outlook 2013 & KB2975808 — Update for Microsoft 2013.
I believe this is a bug in the Lync installer and six patches described above.
After we delete the «2.b» registry key, the application works fine. How can this be submitted to the Office team?
We haven’t yet done full regression testing for the Office 2013 suite, so we’re at risk of breaking other legacy applications if we the upgrade PCs now to Office 2013.
Ian Broadbent
Ian Broadbent
`В настоящее время я использую следующий 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, но, похоже, не нашел решения. Любая помощь будет принята с благодарностью!
1 ответ
Лучший ответ
Скорее всего, у вас нет ссылки на 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
во время выполнения.
1
JNevill
30 Июл 2018 в 19:17