The operation failed because of a registry or installation problem. Restart Outlook and try again.

Hugh Banyon 0 Reputation points
2024-07-18T18:50:10.17+00:00

I got an error "The operation failed because of a registry or installation problem. Restart Outlook and try again." on the last line of this simple procedure trying to execute .GetSharedDefaultFolder method:

Public Sub xxx(Email As String, Subject As String, StartTime As Date, Duration As Integer)

Dim x As Outlook.Application, NameSpace As Outlook.NameSpace

Dim Folder As Outlook.MAPIFolder

Dim Recipient As Outlook.Recipient

Dim Appt As Outlook.AppointmentItem

Dim App As Outlook.Application

Set x = CreateObject("Outlook.Application")

Set NameSpace = x.GetNamespace("MAPI")

Set Recipient = NameSpace.CreateRecipient(Email)

Recipient.Resolve

If Not Recipient.Resolved Then acMsgBox "Unable to contact email account " & Recipient: Exit Sub

Set Folder = NameSpace.GetSharedDefaultFolder(Recipient, olFolderCalendar)

Microsoft 365 and Office | Development | Other
Outlook | Windows | Classic Outlook for Windows | For business
Microsoft 365 and Office | Access | For business | Windows
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.