Exception handling - Running macro via Blue Prism [closed]











up vote
0
down vote

favorite
1












I want to run several macros with BluePrism (makers of "robotic process automation" software) - to do it I am using Microsoft Excel VBO library with 'run macro' action. However I am facing issue with exception handling - if there is some error in macro BP process seems to not catch it and still wait for VBA to finish the process.



Do you know how can I solve it/ any workarounds?










share|improve this question















closed as unclear what you're asking by FreeMan, Comintern, Smandoli, 585connor, Mark Rotteveel Nov 21 at 16:54


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.















  • Hello and welcome to Stack Overflow! Please take the tour and read through the help center to learn what we'll do to help you. You'll have to provide some of the code you've written. If you don't the best you get is random guesses and you'll probably find those aren't helpful to you and only waste your time and the guessers time...
    – FreeMan
    Nov 21 at 15:16















up vote
0
down vote

favorite
1












I want to run several macros with BluePrism (makers of "robotic process automation" software) - to do it I am using Microsoft Excel VBO library with 'run macro' action. However I am facing issue with exception handling - if there is some error in macro BP process seems to not catch it and still wait for VBA to finish the process.



Do you know how can I solve it/ any workarounds?










share|improve this question















closed as unclear what you're asking by FreeMan, Comintern, Smandoli, 585connor, Mark Rotteveel Nov 21 at 16:54


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.















  • Hello and welcome to Stack Overflow! Please take the tour and read through the help center to learn what we'll do to help you. You'll have to provide some of the code you've written. If you don't the best you get is random guesses and you'll probably find those aren't helpful to you and only waste your time and the guessers time...
    – FreeMan
    Nov 21 at 15:16













up vote
0
down vote

favorite
1









up vote
0
down vote

favorite
1






1





I want to run several macros with BluePrism (makers of "robotic process automation" software) - to do it I am using Microsoft Excel VBO library with 'run macro' action. However I am facing issue with exception handling - if there is some error in macro BP process seems to not catch it and still wait for VBA to finish the process.



Do you know how can I solve it/ any workarounds?










share|improve this question















I want to run several macros with BluePrism (makers of "robotic process automation" software) - to do it I am using Microsoft Excel VBO library with 'run macro' action. However I am facing issue with exception handling - if there is some error in macro BP process seems to not catch it and still wait for VBA to finish the process.



Do you know how can I solve it/ any workarounds?







excel vba blueprism






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 at 15:13









FreeMan

4,83112147




4,83112147










asked Nov 21 at 14:32









RobRaj

235




235




closed as unclear what you're asking by FreeMan, Comintern, Smandoli, 585connor, Mark Rotteveel Nov 21 at 16:54


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as unclear what you're asking by FreeMan, Comintern, Smandoli, 585connor, Mark Rotteveel Nov 21 at 16:54


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • Hello and welcome to Stack Overflow! Please take the tour and read through the help center to learn what we'll do to help you. You'll have to provide some of the code you've written. If you don't the best you get is random guesses and you'll probably find those aren't helpful to you and only waste your time and the guessers time...
    – FreeMan
    Nov 21 at 15:16


















  • Hello and welcome to Stack Overflow! Please take the tour and read through the help center to learn what we'll do to help you. You'll have to provide some of the code you've written. If you don't the best you get is random guesses and you'll probably find those aren't helpful to you and only waste your time and the guessers time...
    – FreeMan
    Nov 21 at 15:16
















Hello and welcome to Stack Overflow! Please take the tour and read through the help center to learn what we'll do to help you. You'll have to provide some of the code you've written. If you don't the best you get is random guesses and you'll probably find those aren't helpful to you and only waste your time and the guessers time...
– FreeMan
Nov 21 at 15:16




Hello and welcome to Stack Overflow! Please take the tour and read through the help center to learn what we'll do to help you. You'll have to provide some of the code you've written. If you don't the best you get is random guesses and you'll probably find those aren't helpful to you and only waste your time and the guessers time...
– FreeMan
Nov 21 at 15:16












1 Answer
1






active

oldest

votes

















up vote
0
down vote













First of all, this means the macros are not safe for RPA, since no user interaction will be taking place. You must amend your macros to have no modal message box appear to the robot.



Also you must wrap the macro code with some suitable On Error statement(in the macro sub/function first line) of some sort that resumes or pass to an exit point. That would be the sign of a good macro for users, but absolutely essential for RPA!!



Alternatively if you cannot change macro code, use a timeout routine to kill Excel (maybe through a VBScript that is killed by Blue Prism).




  1. Start VBScript(via Environment VBO), that will kill Excel(with a timeout, say one minute if your macro should have completed by then) just before running macro


  2. Run macro


  3. Next stage after 'Run Macro' is to check if Excel Running using Environment VBO


  4. If macro completes(Excel Running), next stage is to kill VBScript by pID, and continue.


  5. If Excel not running, then you know that Excel did not complete in time, and start to assume VBA/Excel issues.


  6. Maybe put Run Macro action call wrap in one Blue Prism page, so that the HandleMap & InstanceMap of that Excel VBO instance are not compromised, and the instance is not used in further code.







share|improve this answer





















  • This is not good advice even in an RPA context - robotics solutions are designed to model user behavior
    – esqew
    Nov 23 at 12:59










  • how would you solve OP's question as it stands?
    – MacroMarc
    Nov 23 at 13:37










  • If the macros in question are heavily reliant on VB exception handling (as OP suggests), the most ideal solution would be to move the macro code to the MS Excel VBO as a new code stage in its own Action page. See Extending the MS Excel VBO.
    – esqew
    Nov 23 at 13:56




















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













First of all, this means the macros are not safe for RPA, since no user interaction will be taking place. You must amend your macros to have no modal message box appear to the robot.



Also you must wrap the macro code with some suitable On Error statement(in the macro sub/function first line) of some sort that resumes or pass to an exit point. That would be the sign of a good macro for users, but absolutely essential for RPA!!



Alternatively if you cannot change macro code, use a timeout routine to kill Excel (maybe through a VBScript that is killed by Blue Prism).




  1. Start VBScript(via Environment VBO), that will kill Excel(with a timeout, say one minute if your macro should have completed by then) just before running macro


  2. Run macro


  3. Next stage after 'Run Macro' is to check if Excel Running using Environment VBO


  4. If macro completes(Excel Running), next stage is to kill VBScript by pID, and continue.


  5. If Excel not running, then you know that Excel did not complete in time, and start to assume VBA/Excel issues.


  6. Maybe put Run Macro action call wrap in one Blue Prism page, so that the HandleMap & InstanceMap of that Excel VBO instance are not compromised, and the instance is not used in further code.







share|improve this answer





















  • This is not good advice even in an RPA context - robotics solutions are designed to model user behavior
    – esqew
    Nov 23 at 12:59










  • how would you solve OP's question as it stands?
    – MacroMarc
    Nov 23 at 13:37










  • If the macros in question are heavily reliant on VB exception handling (as OP suggests), the most ideal solution would be to move the macro code to the MS Excel VBO as a new code stage in its own Action page. See Extending the MS Excel VBO.
    – esqew
    Nov 23 at 13:56

















up vote
0
down vote













First of all, this means the macros are not safe for RPA, since no user interaction will be taking place. You must amend your macros to have no modal message box appear to the robot.



Also you must wrap the macro code with some suitable On Error statement(in the macro sub/function first line) of some sort that resumes or pass to an exit point. That would be the sign of a good macro for users, but absolutely essential for RPA!!



Alternatively if you cannot change macro code, use a timeout routine to kill Excel (maybe through a VBScript that is killed by Blue Prism).




  1. Start VBScript(via Environment VBO), that will kill Excel(with a timeout, say one minute if your macro should have completed by then) just before running macro


  2. Run macro


  3. Next stage after 'Run Macro' is to check if Excel Running using Environment VBO


  4. If macro completes(Excel Running), next stage is to kill VBScript by pID, and continue.


  5. If Excel not running, then you know that Excel did not complete in time, and start to assume VBA/Excel issues.


  6. Maybe put Run Macro action call wrap in one Blue Prism page, so that the HandleMap & InstanceMap of that Excel VBO instance are not compromised, and the instance is not used in further code.







share|improve this answer





















  • This is not good advice even in an RPA context - robotics solutions are designed to model user behavior
    – esqew
    Nov 23 at 12:59










  • how would you solve OP's question as it stands?
    – MacroMarc
    Nov 23 at 13:37










  • If the macros in question are heavily reliant on VB exception handling (as OP suggests), the most ideal solution would be to move the macro code to the MS Excel VBO as a new code stage in its own Action page. See Extending the MS Excel VBO.
    – esqew
    Nov 23 at 13:56















up vote
0
down vote










up vote
0
down vote









First of all, this means the macros are not safe for RPA, since no user interaction will be taking place. You must amend your macros to have no modal message box appear to the robot.



Also you must wrap the macro code with some suitable On Error statement(in the macro sub/function first line) of some sort that resumes or pass to an exit point. That would be the sign of a good macro for users, but absolutely essential for RPA!!



Alternatively if you cannot change macro code, use a timeout routine to kill Excel (maybe through a VBScript that is killed by Blue Prism).




  1. Start VBScript(via Environment VBO), that will kill Excel(with a timeout, say one minute if your macro should have completed by then) just before running macro


  2. Run macro


  3. Next stage after 'Run Macro' is to check if Excel Running using Environment VBO


  4. If macro completes(Excel Running), next stage is to kill VBScript by pID, and continue.


  5. If Excel not running, then you know that Excel did not complete in time, and start to assume VBA/Excel issues.


  6. Maybe put Run Macro action call wrap in one Blue Prism page, so that the HandleMap & InstanceMap of that Excel VBO instance are not compromised, and the instance is not used in further code.







share|improve this answer












First of all, this means the macros are not safe for RPA, since no user interaction will be taking place. You must amend your macros to have no modal message box appear to the robot.



Also you must wrap the macro code with some suitable On Error statement(in the macro sub/function first line) of some sort that resumes or pass to an exit point. That would be the sign of a good macro for users, but absolutely essential for RPA!!



Alternatively if you cannot change macro code, use a timeout routine to kill Excel (maybe through a VBScript that is killed by Blue Prism).




  1. Start VBScript(via Environment VBO), that will kill Excel(with a timeout, say one minute if your macro should have completed by then) just before running macro


  2. Run macro


  3. Next stage after 'Run Macro' is to check if Excel Running using Environment VBO


  4. If macro completes(Excel Running), next stage is to kill VBScript by pID, and continue.


  5. If Excel not running, then you know that Excel did not complete in time, and start to assume VBA/Excel issues.


  6. Maybe put Run Macro action call wrap in one Blue Prism page, so that the HandleMap & InstanceMap of that Excel VBO instance are not compromised, and the instance is not used in further code.








share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 21 at 15:43









MacroMarc

2,5512516




2,5512516












  • This is not good advice even in an RPA context - robotics solutions are designed to model user behavior
    – esqew
    Nov 23 at 12:59










  • how would you solve OP's question as it stands?
    – MacroMarc
    Nov 23 at 13:37










  • If the macros in question are heavily reliant on VB exception handling (as OP suggests), the most ideal solution would be to move the macro code to the MS Excel VBO as a new code stage in its own Action page. See Extending the MS Excel VBO.
    – esqew
    Nov 23 at 13:56




















  • This is not good advice even in an RPA context - robotics solutions are designed to model user behavior
    – esqew
    Nov 23 at 12:59










  • how would you solve OP's question as it stands?
    – MacroMarc
    Nov 23 at 13:37










  • If the macros in question are heavily reliant on VB exception handling (as OP suggests), the most ideal solution would be to move the macro code to the MS Excel VBO as a new code stage in its own Action page. See Extending the MS Excel VBO.
    – esqew
    Nov 23 at 13:56


















This is not good advice even in an RPA context - robotics solutions are designed to model user behavior
– esqew
Nov 23 at 12:59




This is not good advice even in an RPA context - robotics solutions are designed to model user behavior
– esqew
Nov 23 at 12:59












how would you solve OP's question as it stands?
– MacroMarc
Nov 23 at 13:37




how would you solve OP's question as it stands?
– MacroMarc
Nov 23 at 13:37












If the macros in question are heavily reliant on VB exception handling (as OP suggests), the most ideal solution would be to move the macro code to the MS Excel VBO as a new code stage in its own Action page. See Extending the MS Excel VBO.
– esqew
Nov 23 at 13:56






If the macros in question are heavily reliant on VB exception handling (as OP suggests), the most ideal solution would be to move the macro code to the MS Excel VBO as a new code stage in its own Action page. See Extending the MS Excel VBO.
– esqew
Nov 23 at 13:56





Popular posts from this blog

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

Calculate evaluation metrics using cross_val_predict sklearn

Insert data from modal to MySQL (multiple modal on website)