CaffeinatedMike
CaffeinatedMike

Reputation: 1607

Outlook macro that checks if Excel macro is running

I have an Excel macro that opens Internet Explorer, searches & requests an export for each item in Column A.

The export is sent to my Outlook email and automatically filters into my Import/Export folder. At that point, when it filters into my Import/Export folder, I'd like an Outlook macro to check if the Excel macro is running, because I receive exports at other times too.

If the Excel macro is running I'd like to change/edit the subject line of the email that was just filtered to include the text from a certain HTML tag (which I have the ID for) on the current page from Internet Explorer.

** Is this possible? If you have any suggestion on a better way to go about this I'd be happy to hear it.

Upvotes: 0

Views: 103

Answers (1)

niton
niton

Reputation: 9199

In Excel, just before the first export save 1 to a text file. Once all exports are done, put Excel to sleep for a short time so the mail can reach Outlook then save 0 to the text file.

In Outlook, assume Excel is requesting exports if the text file contains 1.

Edit:
Sample code for Excel How to create and write to a txt file using VBA
Sample code for Outlook: Read/Parse text file line by line in VBA

Upvotes: 1

Related Questions