Hi All,
We have a spreadsheet where live financial market data is streamed on one tab [Sheet1]. On a separate tab [Sheet2], the user can setup trigger alerts that send an e-mail if the trigger criteria is true (e.g. if Sheet1!J20 > 10000000 then send an e-mail). The user can set cell-specific alerts or check all cells within a given range. The user can also set custom e-mail headers for each trigger using custom commands/functions.
Our problem: a macro that checks for triggered events and sends e-mail is currently scheduled (Application.OnTime) to run every 5 seconds. However, if left for a few hours - MS Excel seems to close down without giving an error.
Details of the macro: The macro takes less than a few milliseconds to run. The macro uses three public variables (a date/time for the new scheduled run, a boolean to enable or disable trigger monitoring and the user's sender e-mail address if their SMTP account doesn't use authentication). The macro loops through each complete row on Sheet2 to check if an e-mail needs to be sent for each trigger. All successfully sent e-mails are recorded in Sheet3. The task is actually split up into approx. 5 procedures.
I'm wondering, what's the impact of running a macro all day (8am - 6pm, maybe longer, every 5 seconds)? Is it possible? What isn't possible? Why does Excel close without an error? Is it a buffer issue or processing power issue? Does it matter if certain variables aren't emptied before the macro finishes?
Any help would be much appreciated.
Thanks!
We have a spreadsheet where live financial market data is streamed on one tab [Sheet1]. On a separate tab [Sheet2], the user can setup trigger alerts that send an e-mail if the trigger criteria is true (e.g. if Sheet1!J20 > 10000000 then send an e-mail). The user can set cell-specific alerts or check all cells within a given range. The user can also set custom e-mail headers for each trigger using custom commands/functions.
Our problem: a macro that checks for triggered events and sends e-mail is currently scheduled (Application.OnTime) to run every 5 seconds. However, if left for a few hours - MS Excel seems to close down without giving an error.
Details of the macro: The macro takes less than a few milliseconds to run. The macro uses three public variables (a date/time for the new scheduled run, a boolean to enable or disable trigger monitoring and the user's sender e-mail address if their SMTP account doesn't use authentication). The macro loops through each complete row on Sheet2 to check if an e-mail needs to be sent for each trigger. All successfully sent e-mails are recorded in Sheet3. The task is actually split up into approx. 5 procedures.
I'm wondering, what's the impact of running a macro all day (8am - 6pm, maybe longer, every 5 seconds)? Is it possible? What isn't possible? Why does Excel close without an error? Is it a buffer issue or processing power issue? Does it matter if certain variables aren't emptied before the macro finishes?
Any help would be much appreciated.
Thanks!