Interface IStdInteractionModule
MS-VBAL 6.1.2.8 Interaction Module
[StdLibModule(null)]
public interface IStdInteractionModule
Remarks
Formalizes the public interface of the standard library VBA.Interaction module.
Methods
AppActivate(VBVariantValue, VBVariantValue?)
MS-VBAL 6.1.2.8.2.1 AppActivate
RuntimeSemanticsEvaluationResult AppActivate(VBVariantValue title, VBVariantValue? wait = null)
Parameters
titleVBVariantValueA VBStringValue expression containing the title in the title bar of the application window to activate, or the task ID that Shell(VBVariantValue, VBAppWinStyle) returned.
waitVBVariantValueA VBBooleanValue expression specifying whether the calling application has the focus before activating another.
Optional:Falseunless specified otherwise, which activates the application immediately.
Returns
- RuntimeSemanticsEvaluationResult
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Changes the focus to the named application window, without affecting whether it is maximized or minimized.
👉 The title is compared to the title of each running application; with no exact match, any application whose title begins with it is activated.
👉 Only Windows has application windows to activate; elsewhere this does nothing.
Beep()
MS-VBAL 6.1.2.8.2.2 Beep
RuntimeSemanticsEvaluationResult Beep()
Returns
- RuntimeSemanticsEvaluationResult
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Sounds a tone through the computer's speaker.
👉 The frequency and duration of the beep depend on hardware and system software, and vary among computers. An environment with no speaker to sound it through
has nothing to do, and that is not an error.
CallByName(VBObjectValue, VBStringValue, VBCallType, params VBVariantValue[])
MS-VBAL 6.1.2.8.1.1 CallByName
RuntimeSemanticsEvaluationResult<VBVariantValue> CallByName(VBObjectValue objectValue, VBStringValue procName, VBCallType callType, params VBVariantValue[] args)
Parameters
objectValueVBObjectValueThe object exposing the member to be invoked.
procNameVBStringValueThe name of the member to be invoked.
callTypeVBCallTypeThe type of member invocation.
argsVBVariantValue[]Any arguments to be supplied to the member upon invocation.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Invokes a method or property by name against the specified VBObjectValue.
Choose(VBSingleValue, params VBVariantValue[])
MS-VBAL 6.1.2.8.1.2 Choose
RuntimeSemanticsEvaluationResult<VBVariantValue> Choose(VBSingleValue index, params VBVariantValue[] choice)
Parameters
indexVBSingleValueAn VBIntegerValue between 1 and the number of supplied choices.
choiceVBVariantValue[]An array containing the values to choose from.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Returns a value from a list of choices, selected by a one-based index.
👉 Indexing is one-based regardless of any Option Base directives. An index that is not a whole number is rounded to the nearest one,
the way a Single is Let-coerced to a Long (banker's rounding).
⚠️ This function yields a VBNullValue if the supplied index is out of bounds.
Command()
MS-VBAL 6.1.2.8.1.3 Command
RuntimeSemanticsEvaluationResult<VBVariantValue> Command()
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Gets a VBVariantValue containing the command-line arguments (if any) that were used to initiate the execution of the currently running workspace application.
What those are is the host's to say ("implementation dependent"): none - an empty String - unless it says otherwise, as in a program an Office
application runs (recorded in Excel). The VBVariantValue holds a String.
CommandString()
MS-VBAL 6.1.2.8.1.3 Command$
[StdLibMember("Command$")]
RuntimeSemanticsEvaluationResult<VBStringValue> CommandString()
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Gets a VBStringValue containing the command-line arguments (if any) that were used to initiate the execution of the currently running workspace application.
CreateObject(VBStringValue, VBStringValue?)
MS-VBAL 6.1.2.8.1.4 CreateObject Creates an object of the class a programmatic identifier names (Scripting.Dictionary), on this
machine or on the server machine named.
RuntimeSemanticsEvaluationResult<VBObjectValue> CreateObject(VBStringValue objectClass, VBStringValue? serverName = null)
Parameters
objectClassVBStringValueA VBStringValue containing the application name and class of the object to create.
serverNameVBStringValueA VBStringValue containing the name of the network server where the object will be created.
Optional: the local machine is used unless specified otherwise.
Returns
- RuntimeSemanticsEvaluationResult<VBObjectValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
The name is looked for, whatever its case, among the classes the platform implements itself first (ProgId), which
a program creates by name on any machine; then among the machine's automation servers - COM, on Windows - through the session's external calls, which
an administrator's policy sees. Error 429 ActiveX component can't create object when neither has the class.
A server's object is bound to late, as MS-VBA binds it: its members are reached by name, whatever a type library says of them - error
438 for a name it does not answer to. It is an instance of the class of a referenced library when one declares its class.
As in MS-VBA (recorded in Excel): a server machine that is not there is the HRESULT of the failure (-2147023174), not
error 462.
DeleteSetting(VBStringValue, VBStringValue?, VBStringValue?)
MS-VBAL 6.1.2.8.2.3 DeleteSetting
RuntimeSemanticsEvaluationResult DeleteSetting(VBStringValue appName, VBStringValue? section = null, VBStringValue? key = null)
Parameters
appNameVBStringValueA VBStringValue expression containing the name of the application or project to which the section or key setting applies.
sectionVBStringValueA VBStringValue expression containing the name of the section where the key setting is being deleted.
Optional: given only the application name, every section of the application is deleted; given the section as well, the section is deleted with all of its key settings.keyVBStringValueA VBStringValue expression containing the name of the key setting being deleted.
Optional.
Returns
- RuntimeSemanticsEvaluationResult
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Deletes a section or key setting from an application's entry in an implementation-defined application registry.
💥 A run-time error occurs if the section or key setting does not exist.
DoEvents()
MS-VBAL 6.1.2.8.1.5 DoEvents
RuntimeSemanticsEvaluationResult<VBIntegerValue> DoEvents()
Returns
- RuntimeSemanticsEvaluationResult<VBIntegerValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Yields execution so the operating system can process externally generated events.
👉 This function returns an VBIntegerValue with an implementation-defined meaning.
Environ(VBVariantValue)
MS-VBAL 6.1.2.8.1.6 Environ
RuntimeSemanticsEvaluationResult<VBVariantValue> Environ(VBVariantValue key)
Parameters
keyVBVariantValueA VBStringValue, or a data value that is let-coercible to VBLongValue.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Gets a VBVariantValue (VBStringValue) associated with an implementation-defined environment variable.
EnvironString(VBVariantValue)
MS-VBAL 6.1.2.8.1.6 Environ$
[StdLibMember("Environ$")]
RuntimeSemanticsEvaluationResult<VBStringValue> EnvironString(VBVariantValue key)
Parameters
keyVBVariantValueA VBStringValue, or a data value that is let-coercible to VBLongValue.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Gets a VBStringValue associated with an implementation-defined environment variable.
GetAllJsonSettings(VBStringValue, VBStringValue?)
🧩 RD-VBAL 6.1.2.8.1.7.1 GetAllJsonSettings
RuntimeSemanticsEvaluationResult<VBVariantValue> GetAllJsonSettings(VBStringValue key, VBStringValue? config = null)
Parameters
keyVBStringValueA VBStringValue expression containing the managed configuration path (e.g.
"Configuration:ConnectionStrings") of the configuration section whose key settings are requested.configVBStringValueA VBStringValue expression containing the name of a .json configuration file associated with the workspace application.
Optional: The default value of this parameter depends on the current host configuration (normally"appsettings.json").
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Gets a two-dimensional VBArrayValue containing VBStringValue elements representing
the configuration setting keys and values of the specified managed configuration section if it exists; returns VBEmptyValue otherwise.
👉 Always the workspace application settings, whatever store GetAllSettings(VBStringValue, VBStringValue) is configured to use. A child of the section that is a section of its
own (it has children, and no value) is not a key setting of it, and is left out.
GetAllSettings(VBStringValue, VBStringValue)
MS-VBAL 6.1.2.8.1.7 GetAllSettings
RuntimeSemanticsEvaluationResult<VBVariantValue> GetAllSettings(VBStringValue appName, VBStringValue section)
Parameters
appNameVBStringValueA VBStringValue expression containing the name of the application or project whose key settings are requested.
sectionVBStringValueA VBStringValue expression containing the name of the configuration section whose key settings are requested.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Gets a two-dimensional VBArrayValue containing VBStringValue elements representing
the configuration setting keys and values of the specified settings store section if it exists under the specified application name; returns VBEmptyValue otherwise.
👉 The settings store is the workspace application settings (ProgramSettings:appName:section in the workspace's appsettings.json), unless the
environment asks for the legacy Windows Registry store (LegacyRegistrySettings), which only Windows has.
GetAttr(VBStringValue)
MS-VBAL 6.1.2.8.1.8 GetAttr
[StdLibMember(null, ReturnType = typeof(VBFileAttribute))]
RuntimeSemanticsEvaluationResult<VBLongValue> GetAttr(VBStringValue pathName)
Parameters
pathNameVBStringValueA VBStringValue expression containing a file name. May specify a mapped drive and/or a directory/folder path.
Returns
- RuntimeSemanticsEvaluationResult<VBLongValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Gets the VBFileAttribute bitwise flags representing the attributes of a specified file or directory/folder.
GetJsonSetting(VBStringValue, VBStringValue?, VBVariantValue?)
🧩 RD-VBAL 6.1.2.8.1.10.1 GetJsonSetting
RuntimeSemanticsEvaluationResult<VBVariantValue> GetJsonSetting(VBStringValue key, VBStringValue? config = null, VBVariantValue? defaultValue = null)
Parameters
keyVBStringValueA VBStringValue expression containing the managed configuration path (e.g.
"Configuration:ConnectionStrings:AppDb") of the configuration section whose key settings are requested.configVBStringValueA VBStringValue expression containing the name of a .json configuration file associated with the workspace application.
Optional: The default value of this parameter depends on the current host configuration (normally"appsettings.json").defaultValueVBVariantValueA VBVariantValue expression containing the value to return if no value is set in the key setting.
Optional: defaults to ZeroLengthString.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Gets a VBStringValue representing the value of the specified managed configuration setting if it exists; gets the specified defaultValue otherwise.
GetObject(VBVariantValue?, VBVariantValue?)
MS-VBAL 6.1.2.8.1.9 GetObject Gets the object of a class that is running, the one a file is, or a new one.
RuntimeSemanticsEvaluationResult<VBObjectValue> GetObject(VBVariantValue? pathName = null, VBVariantValue? className = null)
Parameters
pathNameVBVariantValueThe file, or the moniker, of the object; a zero-length
Stringfor a new one.classNameVBVariantValueThe programmatic identifier of the class (
Excel.Application).
Returns
- RuntimeSemanticsEvaluationResult<VBObjectValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
As in MS-VBA (recorded in Excel), through the session's external calls as CreateObject(VBStringValue, VBStringValue?), and bound to late as its objects are:
GetObject(, class): the object of the class that is running; error429when none is, or the class is not registered;GetObject(path),GetObject(path, class): the object the file is, opened by its own class or the one named - or the one a moniker names (winmgmts:); error432File name or class name not found when the file is not there;GetObject("", class): a new object of the class, as CreateObject(VBStringValue, VBStringValue?);GetObject()is error13, andGetObject("")error5.
A class the platform implements itself is a new object of it, the one CreateObject(VBStringValue, VBStringValue?) gives, for GetObject("", class); it has none
running and opens no file.
GetSetting(VBStringValue, VBStringValue, VBStringValue, VBVariantValue?)
MS-VBAL 6.1.2.8.1.10 GetSetting
RuntimeSemanticsEvaluationResult<VBVariantValue> GetSetting(VBStringValue appName, VBStringValue section, VBStringValue key, VBVariantValue? defaultValue = null)
Parameters
appNameVBStringValueA VBStringValue expression containing the name of the application or project whose key settings are requested.
sectionVBStringValueA VBStringValue expression containing the name of the configuration section whose key settings are requested.
keyVBStringValueA VBStringValue expression containing the key of the requested key setting value.
defaultValueVBVariantValueA VBVariantValue expression containing the value to return if no value is set in the key setting.
Optional: defaults to ZeroLengthString.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Gets a VBStringValue representing the key setting value from the specified application's entry in an implementation-defined application registry if it exists; gets the specified defaultValue otherwise.
👉 The registry is the workspace application settings (ProgramSettings:appName:section:key in the workspace's appsettings.json), unless the
environment asks for the legacy Windows Registry store (LegacyRegistrySettings), which only Windows has.
IIf(VBVariantValue, VBVariantValue, VBVariantValue)
MS-VBAL 6.1.2.8.1.11 IIf
RuntimeSemanticsEvaluationResult<VBVariantValue> IIf(VBVariantValue expression, VBVariantValue truePart, VBVariantValue falsePart)
Parameters
expressionVBVariantValueThe expression to evaluate, Let-coerced to
Boolean.truePartVBVariantValueThe value returned when
expressionisTrue.falsePartVBVariantValueThe value returned when
expressionis notTrue.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Returns one of two parts, depending on the evaluation of an expression.
👉 Both parts are evaluated, whichever is returned: they are arguments. A Null expression is not True, and returns falsePart.
💡 The wording of how this function and its parameters are specified does not exclude 🧩VBDeferredValue language core extension values that could...
fix the confusion around this function while opening the door to something like first-class delegates in (extended) RD-VBA.
InputBox(VBVariantValue, VBVariantValue?, VBVariantValue?, VBVariantValue?, VBVariantValue?, VBVariantValue?, VBVariantValue?)
MS-VBAL 6.1.2.8.1.12 InputBox
RuntimeSemanticsEvaluationResult<VBStringValue> InputBox(VBVariantValue prompt, VBVariantValue? title = null, VBVariantValue? defaultValue = null, VBVariantValue? xpos = null, VBVariantValue? ypos = null, VBVariantValue? helpFile = null, VBVariantValue? helpContext = null)
Parameters
promptVBVariantValueA VBStringValue expression containing the message to be displayed in the dialog box.
titleVBVariantValueA VBStringValue expression containing the title of the dialog box.
Optional: uses the name of the workspace project if omitted.defaultValueVBVariantValueA VBStringValue expression containing the default (pre-filled) value.
Optional: defaults to ZeroLengthString.xposVBVariantValueA VBLongValue expression containing the horizontal distance (measured in twips) of the left edge of the dialog box from the left edge of the screen.
Optional: dialog is horizontally centered if omitted.yposVBVariantValueA VBLongValue expression containing the vertical distance (measured in twips) of the top edge of the dialog box from the top edge of the screen.
Optional: dialog is vertically centered if omitted.helpFileVBVariantValueℹ️ Unsupported legacy proprietary Microsoft help system. This parameter is out of scope of this implementation.
helpContextVBVariantValueℹ️ Unsupported legacy proprietary Microsoft help system. This parameter is out of scope of this implementation.
Returns
- RuntimeSemanticsEvaluationResult<VBStringValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Displays a prompt in a dialog box, waits for the user to input text or click a button, and returns a VBStringValue containing the user-provided input.
👉 A dialog that is cancelled - its Cancel button, or Esc - returns vbNullString, a string bound to a null pointer; a dialog confirmed with
nothing typed returns a zero-length string. The two compare equal, and StrPtr is how a caller tells them apart.
MacScript(VBStringValue)
MacScript Runs an AppleScript script and returns what it returns.
[StdLibMember(null, IsHidden = true)]
RuntimeSemanticsEvaluationResult<VBVariantValue> MacScript(VBStringValue script)
Parameters
scriptVBStringValueThe AppleScript source, or the path of a compiled script.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
A hidden member of MS-VBA's Interaction module, kept for the Macintosh versions of Office. It resolves, so that code written for both platforms
compiles, and raises a run-time error when it is called: RD-VBA has no AppleScript to run.
MsgBox(VBVariantValue, VBMsgBoxStyle, VBVariantValue?, VBVariantValue?, VBVariantValue?)
MS-VBAL 6.1.2.8.1.13 MsgBox
[StdLibMember(null, ReturnType = typeof(VBMsgBoxResult))]
RuntimeSemanticsEvaluationResult<VBLongValue> MsgBox(VBVariantValue prompt, VBMsgBoxStyle buttons = VBMsgBoxStyle.VBApplicationModal, VBVariantValue? title = null, VBVariantValue? helpFile = null, VBVariantValue? helpContext = null)
Parameters
promptVBVariantValueA VBStringValue expression containing the message to be displayed in the dialog box.
buttonsVBMsgBoxStyleA VBMsgBoxStyle expression containing the sum of values specifying the number and type of buttons to display, the icon style to use, the identity of the default button, and the modality of the message box.
Optional: defaults to VBDefaultButton1 (VBIntegerValue0).titleVBVariantValueA VBStringValue expression containing the title of the dialog box.
Optional: uses the name of the workspace project if omitted.helpFileVBVariantValueℹ️ Unsupported legacy proprietary Microsoft help system. This parameter is out of scope of this implementation.
helpContextVBVariantValueℹ️ Unsupported legacy proprietary Microsoft help system. This parameter is out of scope of this implementation.
Returns
- RuntimeSemanticsEvaluationResult<VBLongValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Displays a message in a dialog box, waits for the user to click a button, and returns a VBMsgBoxResult value indicating which button the user clicked.
👉 Esc closes the dialog at window level, as its close button does: it answers VBCancel when the dialog has a
Cancel button, VBOk when OK is its only button, and does nothing for VBYesNo and
VBAbortRetryIgnore, which cannot be dismissed without choosing.
Partition(VBVariantValue, VBVariantValue, VBVariantValue, VBVariantValue)
MS-VBAL 6.1.2.8.1.14 Partition
RuntimeSemanticsEvaluationResult<VBVariantValue> Partition(VBVariantValue number, VBVariantValue start, VBVariantValue stop, VBVariantValue interval)
Parameters
numberVBVariantValueA VBLongValue expression containing the value to be evaluated against the range.
startVBVariantValueA VBLongValue expression containing the start of the overall range of numbers.
👉 The numeric value of this parameter cannot be less than0💥InvalidProcedureCallOrArgument.stopVBVariantValueA VBLongValue expression containing the end of the overall range of numbers.
👉 The numeric value of this parameter cannot be less than or equal to thestartvalue 💥InvalidProcedureCallOrArgument.intervalVBVariantValueA VBLongValue expression containing the interval of each range of numbers.
👉 The numeric value of this parameter cannot be less than1💥InvalidProcedureCallOrArgument.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Returns a VBStringValue indicating where a number occurs within a calculated series of ranges.
As in MS-VBA (recorded in Excel):
- a range is
lower:upper, the last one ending atstop; before the first it is:start-1, and after the laststop+1:; - each side of the colon is padded with leading spaces to the width of the wider of
start-1andstop+1, so that the ranges sort as text (Partition(195, 20, 199, 10)is"190:199", not the spec's four characters a side); - each part is a number rounded to a whole one as a
Longis, half to even - one too large for aLongis past the range, not an overflow - and one that is no number is error13; - a
Nullpart makes the resultNull, whatever the others are; the result is otherwise aStringin a VBVariantValue.
SaveJsonSetting(VBStringValue, VBStringValue, VBStringValue?)
🧩 RD-VBAL 6.1.2.8.2.4.1 SaveJsonSetting
RuntimeSemanticsEvaluationResult SaveJsonSetting(VBStringValue key, VBStringValue setting, VBStringValue? config = null)
Parameters
keyVBStringValueA VBStringValue expression containing the managed configuration path of the setting (e.g.
"Configuration:ConnectionStrings:AppDb").settingVBStringValueA VBStringValue expression containing the value the setting is being set to.
configVBStringValueA VBStringValue expression containing the name of a .json configuration file associated with the workspace application.
Optional: The default value of this parameter depends on the current host configuration (normally"appsettings.json").
Returns
- RuntimeSemanticsEvaluationResult
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Saves a managed configuration setting in the workspace application settings, creating the sections of its path - and the file - as needed:
what GetJsonSetting(VBStringValue, VBStringValue?, VBVariantValue?) reads back.
💥 An error occurs if the setting can't be saved for any reason. The value is written as a JSON string, and a configuration file that is written to is written
as JSON without its comments.
SaveSetting(VBStringValue, VBStringValue, VBStringValue, VBStringValue)
MS-VBAL 6.1.2.8.2.4 SaveSetting
RuntimeSemanticsEvaluationResult SaveSetting(VBStringValue appName, VBStringValue section, VBStringValue key, VBStringValue setting)
Parameters
appNameVBStringValueA VBStringValue expression containing the name of the application or project to which the setting applies.
sectionVBStringValueA VBStringValue expression containing the name of the section where the key setting is being saved.
keyVBStringValueA VBStringValue expression containing the name of the key setting being saved.
settingVBStringValueA VBStringValue expression containing the value the key is being set to.
Returns
- RuntimeSemanticsEvaluationResult
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Saves or creates an application entry in the application's entry in the implementation-defined application registry.
💥 An error occurs if the key setting can't be saved for any reason.
SendKeys(VBStringValue, VBVariantValue?)
MS-VBAL 6.1.2.8.2.5 SendKeys
RuntimeSemanticsEvaluationResult SendKeys(VBStringValue @string, VBVariantValue? wait = null)
Parameters
stringVBStringValueA VBStringValue expression specifying the keystrokes to send.
waitVBVariantValueA VBBooleanValue expression specifying the wait mode.
Optional:Falseunless specified otherwise, which returns control to the procedure immediately after the keys are sent. WithTrue, the keystrokes must be processed before control is returned.
Returns
- RuntimeSemanticsEvaluationResult
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Sends one or more keystrokes to the active window as if typed at the keyboard.
👉 Only Windows has an active window to send them to; elsewhere this does nothing.
Shell(VBVariantValue, VBAppWinStyle)
MS-VBAL 6.1.2.8.1.15 Shell
RuntimeSemanticsEvaluationResult<VBDoubleValue> Shell(VBVariantValue path, VBAppWinStyle windowStyle = VBAppWinStyle.VBMinimizedFocus)
Parameters
pathVBVariantValueA VBStringValue expression containing the name of the program to run, and any arguments or command-line switches it takes.
windowStyleVBAppWinStyleA VBIntegerValue (VBAppWinStyle) expression containing a value that sets the style of the window in which the program is to be executed.
Optional: VBMinimizedFocus unless specified otherwise.
Returns
- RuntimeSemanticsEvaluationResult<VBDoubleValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Asynchronously runs an executable program and returns a VBDoubleValue representing the implementation-defined program's task ID (or process ID) if successful, otherwise returns the data value 0.
👉 Only Windows runs the program; elsewhere nothing is run, and the answer is 0.
Switch(params VBVariantValue[])
MS-VBAL 6.1.2.8.1.16 Switch
RuntimeSemanticsEvaluationResult<VBVariantValue> Switch(params VBVariantValue[] varExpr)
Parameters
varExprVBVariantValue[]A VBArrayValue containing VBVariantValue elements representing expressions to be evaluated.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.
Remarks
Evaluates a list of expressions and returns a VBVariantValue or an expression associated with the first expression in the list that evaluates to the data value True.
- The expressions are evaluated left to right;
- The first element (at index
n+0) in thenth pair of values is the expression to be evaluated; - The second element (at index
n+1) in thenth pair of values is the associated value to return if the first element evaluates toTrue; - 💥InvalidProcedureCallOrArgument if the expressions aren't properly paired.
👉 There seems to be a 🧩
VBDeferredValue language core extension opportunity here, too. See: IIf(VBVariantValue, VBVariantValue, VBVariantValue)