cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to create a failure when a pop up error occurs in Excel?

tdavison2
Organizer

Hello,

I am trying to figure out how to achieve this. I need to create a script that opens Excel --> Performs a Refresh --> Closes Excel. The refresh actually does a Connection to an external server to populate the data in the Spreadsheet.


Occasionally, when we refresh, we get a time out error, or other various communication errors. I need to have the script alert on when it does create a pop up error. Most of the time, nothing changes at all on the spreadsheet after a refresh, so I am not sure how to write the script to look for the pop up error and mark it as a Failure.

Thank you very much for any help,

Tom

2 REPLIES 2

yuriy_look
Inactive

Hi Tom,

If you know the exact line of the script where pop-up might
come (which looks to be the case based upon your description) you can try to
attach to it with tpAttachNoWait and then use Exists method, like it is shown
at https://community.dynatrace.com/community/display/ENTSYM124/Suppressing+Fail+To+Attach+Errors.

If pop-up may appear at unpredictable moment during the
script execution, you can create a window event and wait for it using Whenever method,
see https://community.dynatrace.com/community/display/ENTSYM124/Whenever+Method
and https://community.dynatrace.com/community/display/ENTSYM124/Script+and+Application+Synchronization.

No matter how you detect the pop-up that indicates the error
condition, you can use Framework RaiseError function described at https://community.dynatrace.com/community/display/ENTSYM124/General+Scripting+Functions.

Thank you,

Yuriy

Hello Yuriy,

Thank you very much for the detailed response. Very helpful.

Thanks,

Tom