Call Excel 2002 Macro from Outlook 2002

  • Thread starter Thread starter Reto Walker
  • Start date Start date
R

Reto Walker

Hello everyone

I have posted this to the regular Outlook forum but there seems to be no
easy solution to the following question:

How can I run an Excel 2002 macro (which already exists and sends out an
Excel selection via e-mail) whenever I receive an e-mail in Outlook with a
certain subject?

E.g. when Outlook (2002) receives an e-mail with subject: "Run Excel Macro"
it should activate Excel and run the macro.

I tried to accomplish this task by using "Outlook's Rules Wizard - Run
Script" selection but have failed to get a simple macro such as:

Sub SendMailOutlook()
Application.Run "'Tradestation.xls'!MailValue"
End Sub

working proberly.

Any help is highly appreciated.

Regards,

Reto
 
If your code below is Outlook VBA, the Application object referred to is
Outlook's intrinsic Application object. If you want to run an Excel macro,
you need an Excel Application object:

Set objExcel = CreateObject("Excel.Application")
Set objWB = objExcel.Workbooks.Open("C:\mymacro.xls")
objExcel.Run ("MyMacro.xls!MyMacro")
 
Back
Top