0
votes

I am attempting to call an Outlook macro from Excel and pass two or more arguments to it. I have successfully passed 1 argument with the following code:

Dim OutApp As Object
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon

Dim Arg1 As String
Dim Arg2 As String

Arg1 = "A"
Arg2 = "B"

OutApp.TempTest (Arg1)

where TempTest is the Outlook procedure. I've attempted to add the 2nd argument by replacing the last line of code with

OutApp.TempTest (Arg1, Arg2)

but as soon as I finish typing I get a Compile error: Expected: =

I've seen posts where someone is passing to Excel or Access and uses the Run method, but Outlook does not support that.

1
Thanks Doug! That works perfectly. - tanner

1 Answers

0
votes

Community wiki. Answer is in a comment. Anyone finding this topic in a search will see there is an answer and is more likely to look in for a hopefully useful answer.

"Just remove the parentheses." – Doug Glancy