Shell Function

Starts another application and defines the respective window style, if necessary.

Syntax:

Shell (Pathname As String[, Windowstyle As Integer[, Param As String[, bSync]]])

Parameters:

рдкрдердирд╛рдо

Name of the program that you want to start, optionally with complete path and/or arguments.

Windowstyle

Optional integer expression that specifies the style of the window that the program is executed in.

note

Parameter Windowstyle is only effective on Windows systems. On other systems the parameter is ignored.


The following values are possible:

Windowstyle

Meaning

0

рдлрд╝реЛрдХрд╕ рдЫреБрдкреЗ рдкреНрд░реЛрдЧреНрд░рд╛рдо рд╡рд┐рдВрдбреЛ рдореЗрдВ рд╣реИ.

Not implemented in LibreOffice.

1

рдлрд╝реЛрдХрд╕ рдкреНрд░реЛрдЧреНрд░рд╛рдо рд╡рд┐рдВрдбреЛ рдореЗрдВ рдорд╛рдирдХ рдЖрдХрд╛рд░ рдореЗрдВ рд╣реИ.

Not implemented in LibreOffice.

2

рдлрд╝реЛрдХрд╕ рдиреНрдпреВрдирддрдо рдкреНрд░реЛрдЧреНрд░рд╛рдо рд╡рд┐рдВрдбреЛ рдкрд░ рд╣реИ.

3

рдлрд╝реЛрдХрд╕ рдиреНрдпреВрдирддрдо рдкреНрд░реЛрдЧреНрд░рд╛рдо рд╡рд┐рдВрдбреЛ рдкрд░ рд╣реИ.

4

рдорд╛рдирдХ рдЖрдХрд╛рд░ рдкреНрд░реЛрдЧреНрд░рд╛рдо рд╡рд┐рдВрдбреЛ, рдлрд╝реЛрдХрд╕ рдХреЗ рдмрдЧреИрд░.

Not implemented in LibreOffice.

6

рдиреНрдпреВрдирддрдо рдкреНрд░реЛрдЧреНрд░рд╛рдо рд╡рд┐рдВрдбреЛ, рдлрд╝реЛрдХрд╕ рд╕рдХреНрд░рд┐рдп рд╡рд┐рдВрдбреЛ рдкрд░ рд╣реА рд░рд╣реЗрдЧрд╛.

Not implemented in LibreOffice.

10

рдкреВрд░реЗ рд╕реНрдХреНрд░реАрди рдореЗрдВ рдкреНрд░рджрд░реНрд╢рди.


note

Windowstyle 3 and 10 are equivalent in Windows systems.


Param

String that specifies additional arguments passed to the program.

bSync

If this value is set to true, the Shell command and all LibreOffice tasks wait until the shell process completes. If the value is set to false, the shell returns directly. The default value is false.

Error codes:

5 Invalid procedure call

D'oh! You found a bug (text/sbasic/shared/00000003.xhp#err53 not found).

73 Not implemented

Example:


Sub ExampleShellForWin
    Shell("c:\windows\calc.exe",2)
End Sub

Please support us!