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
  • 963,270
  • 265
  • 3,804
  • 3,187
Kelaref
  • 517
  • 1
  • 6
  • 24

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
  • 57,446
  • 3
  • 49
  • 77