Run VBScript Action(Power Automate Desktop)

08/22/2023

Japanese version.

An action that executes an arbitrary VBScript.

This is useful for using existing VBScript assets or for performing processing that is difficult to perform with actions alone.

However, it requires the input of the program code itself.

Therefore, it is recommended to use VBScript only minimally in an environment used by non-system engineers.

However, complex conditional expressions are too large to be processed by Actions, so it may be more convenient to use code.

How to use

Drag "Run VBScript" from "Scripting" under "Actions".

Set parameters.

Parameter

VBScript to run

Specifies the VBScript code to execute.

Power Automate Desktop variables are available in this (enclose the variable name with %).

And the result in WScript.StdOut.Write.

The basic form is to receive the results in VBScriptOutput of Variables produced.

Script to run.
Dialog displayed on the first line.
Variables produced as a result.

Variables produced

The result of the execution of the "VBScript to be executed" is set.

VBScriptOutput

The results of VBScript execution and standard output are stored.

Specifying the code as follows will set the standard output.

WScript.StdOut.Write(content)

This can be used to return calculation results to flow.

Code example.
Execution result of the code example.

ScriptError

VBScript error output (WScript.StdErr.Write), runtime errors and syntax errors are set.

WScript.StdErr.Write(content)
Execution result of the code example.

In addition to the specified contents, runtime and syntax errors will be added.

For those who want to learn Power Automate Desktop effectively


The information on this site is now available in an easy-to-read e-book format.

Or Kindle Unlimited (unlimited reading).

You willl discover how to about basic operations.

By the end of this book, you will be equipped with the knowledge you need to use Power Automate Desktop to streamline your workflow.

Links

Scripting Actions

Examples of Use

Excel cell format.

How to convert Excel and PDF file to each other.