Kelaref
Kelaref

Reputation: 517

VBA: Call Outlook Macro From Excel. Object Does not support property or method

I am trying to call a public macro stored in ThisOutlookSession from an excel macro. The outlook is open at all times.

I found the following: Call outlook VBA from Excel

My excel code:

Set myOutlookApp = GetObject(, "Outlook.Application")
If Not myOutlookApp Is Nothing Then myOutlookApp.ReadEmails

On the second line i get an error:

Run-time error '438': Object doesn't support this property or method

Your help is greatly appreciated.

Upvotes: 0

Views: 728

Answers (1)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66215

You cannot access Outlook macros using syntax like Application.YourFunctionName. You will need to convert your Outlook VBA code to an Excel VBA script.

Upvotes: 1

Related Questions