I've got a pair of macros that interact with Outlook and Excel. The process starts when a new email comes into my inbox. The first Outlook macro kicks on and opens a specific Excel document. It then takes apart the email body and subject and passes those strings as vars to the Excel doc. Once the Outlook macro finishes passing Excel takes over and does a find command to find a match of a string var on the doc. Once it's found, it places the strings in related cells.
The issue I'm running into is activating Excel in a way that sets focus on it so that Excel's VBA can actually execute. Under my current circumstances the following behavior is observed:
Email comes in. Outlook VBA takes over and splits apart the strings. Outlook VBA then calls the Excel VBA macro to take over - at this point execution stops until the user manually sets focus on Excel. Then the Excel macro starts execution with a msgbox stating that it is now firing.
I need to dodge this having to manually set focus on Excel. These macros are intended to operate in complete autonomy except when things go catastrophically wrong. (There's a few debug routines built in to stop the greater operations and alert a human that things are wrong.)
I've poked around and become aware of a few methods but none of which I've been able to digest to a point of capitalizing on them.
TL;DR: I need Outlook to set focus an Excel doc which it opened via a string path so that the Excel doc can execute macro functions autonomously.
The issue I'm running into is activating Excel in a way that sets focus on it so that Excel's VBA can actually execute. Under my current circumstances the following behavior is observed:
Email comes in. Outlook VBA takes over and splits apart the strings. Outlook VBA then calls the Excel VBA macro to take over - at this point execution stops until the user manually sets focus on Excel. Then the Excel macro starts execution with a msgbox stating that it is now firing.
I need to dodge this having to manually set focus on Excel. These macros are intended to operate in complete autonomy except when things go catastrophically wrong. (There's a few debug routines built in to stop the greater operations and alert a human that things are wrong.)
I've poked around and become aware of a few methods but none of which I've been able to digest to a point of capitalizing on them.
TL;DR: I need Outlook to set focus an Excel doc which it opened via a string path so that the Excel doc can execute macro functions autonomously.