0
votes

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.

1
Have you tried making the subroutine 'ReadMails' public?user7690917
@bub yes i mentioned above that it's publicKelaref

1 Answers

1
votes

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