This is not a duplicate of: Can I set a Excel Application Object to point to an already open instance of Excel?
The idea is to execute a VBA sub contained in an Excel instance that is already open from Outlook
I am running the VBA sub as part of a rule in Outlook.
This is my code:
On Error Resume Next
Dim tPath As String
tPath = "X:\Lucas\LucasSheet.xlsm"
Dim exApp As New Excel.Application
Dim wb As Excel.Workbook
wb = System.Runtime.InteropServices.Marshal.BindToMoniker(tPath)
Unfortunately at this point, when running in debug mode I can see that wb is equal to Nothing
Set exApp = wb.Parent
usedSub = "PrintSingle"
exApp.Run usedSub
wb.Close False
Is it possible to make this code work in Outlook 2010?