Leggi e rivedi la documentazione di Automation Anywhere

Automation 360

Chiudi contenuti


Apri contenuti

Example of using the VBScript package in a resilient bot

  • Aggiornato: 2021/10/09
    • Automation 360 v.x
    • Crea
    • Spazio di lavoro RPA
    • Esempi

Example of using the VBScript package in a resilient bot

Build a bot that executes a Microsoft Visual Basic script. Use the Try/Catch package to gracefully end the bot if it fails, making it resilient to crashes. A resilient bot allows scheduled and queued bots to continue even if the current bot encounters an error.

In this bot, you ask the user to provide a number. The bot passes the number to a Microsoft Visual Basic script to multiply by pi and return the value. The bot then reports the result to the user. You can use the VBScript action to either import an external script or type it directly into your bot. In this example, you manually type the script. You also add resiliency to the bot by adding error handling.


  1. Create a bot:
    1. On the left panel, click Automation.
      A list of available bots and forms is displayed.
    2. Click Create New > Bot.
    3. Provide a name for the bot: MultiplyPi
    4. Enter the folder location: Bots\TaskBotExample
    5. Click Create and Edit.
  2. Create a variable: nPromptAnswer:
    • Type: Number
    • Name: nPromptAnswer
  3. Create a variable: lNumbersForPi:
    • Type: List
    • Subtype: Number
    • Name: lNumbersForPi
  4. Click Save.
  5. Use the Prompt > For value action to ask the user for a number.
    1. Click the Show link on the Actions pane.
    2. Double-click or drag the Prompt For value action to add it to the bot.