Gideon du Toit
New Member
- Joined
- May 22, 2023
- Messages
- 29
- Office Version
- 2010
- Platform
- Windows
Good Day Everyone,
I have been developing an Excel app that at some point has to open Outlook. Until a few days ago this was working fine. I am using Office 2010 for the development since it works nicely for backward compatibility.
I also had Office 365 on this machine but decided to remove it because of space concerns and I prefer to use 2010. However, since removing it, I keep getting an Automation Error - Library not Registered.
I have the Office Outlook 14 library included in the references and my code used to run perfectly, yet I am now stuck with a seemingly unsolvable issue. On the internet, I have found several suggestions such as reinstalling Office 2010 and re-registering the dll's and I have tried them all to no avail. I am including some screenshots and my code hereunder in the hope that someone might help me solve this issue.
Thank you in advance!
I have been developing an Excel app that at some point has to open Outlook. Until a few days ago this was working fine. I am using Office 2010 for the development since it works nicely for backward compatibility.
I also had Office 365 on this machine but decided to remove it because of space concerns and I prefer to use 2010. However, since removing it, I keep getting an Automation Error - Library not Registered.
I have the Office Outlook 14 library included in the references and my code used to run perfectly, yet I am now stuck with a seemingly unsolvable issue. On the internet, I have found several suggestions such as reinstalling Office 2010 and re-registering the dll's and I have tried them all to no avail. I am including some screenshots and my code hereunder in the hope that someone might help me solve this issue.
Thank you in advance!
VBA Code:
Sub Send_Email_1() 'EMail Tablets
Dim EmailApp As Outlook.Application
Dim NewEmailItem As Outlook.MailItem
Dim strSource As String
Dim strRecipient As String
Dim strCC As String
Set EmailApp = New Outlook.Application
Set NewEmailItem = EmailApp.CreateItem(olMailItem)
strAlertBody = "We are require " & CStr(Sheet6.Range("F46").Value) & " Tablets and SIM cards for the " & Sheet1.Range("B1").Value & _
"Project, which runs between " & Sheet1.Range("B4").Value & " and " & Sheet1.Range("B5").Value & ". The Project Manager " & _
"will be " & Sheet1.Range("B2").Value & " and can be contacted at " & Sheet1.Range("D2").Value & " or " & _
Sheet1.Range("C2").Value & "."
strSource = "Good Day," & vbNewLine & vbNewLine & "This email was automatically generated from the Excel Project Management App." & _
vbNewLine & vbNewLine & strAlertBody & vbNewLine & vbNewLine & "Regards" & vbNewLine & "Project Management"
strRecipient = CStr(Sheet6.Range("H55").Value)
strCC = CStr(Sheet6.Range("H56").Value)
On Error Resume Next
With NewEmailItem
.To = strRecipient
.CC = strCC
.Subject = "Tablets for Project"
.Body = strSource
Call MyMacroThatUseOutlook
'.Attachments.Add ("Path)
.Send
.Close (olSave)
Set EmailApp = Nothing
Set NewEmailItem = Nothing
End With
strLogEvent = " Email for Tablets and SIM Cards was sent"
Call Log_Event
End Sub
VBA Code: