0

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.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Kelaref
  • 547
  • 1
  • 8
  • 26

1 Answers1

1

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

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78