facebook twitter hatena line email

「Libreoffice/表計算/マクロphp連携」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(ページの作成:「==引数なしであれば実行できる== <pre> Sub TestPHPScript() Dim oShell As Object oShell = CreateUnoService("com.sun.star.system.SystemShellExecute")...」)
 
(相違点なし)

2026年2月16日 (月) 15:32時点における最新版

引数なしであれば実行できる

Sub TestPHPScript()
    Dim oShell As Object
    oShell = CreateUnoService("com.sun.star.system.SystemShellExecute")
    Dim sCmd As String
    Dim sArgs As String
    sCmd = "/opt/homebrew/bin/php"
    sArgs = "/d/www/php/test.php"
    oShell.execute sCmd, sArgs, 1
    MsgBox "called"
End Sub

引数ありだと失敗する

Sub TestPHPScript()
    Dim oShell As Object
    oShell = CreateUnoService("com.sun.star.system.SystemShellExecute")
    Dim sCmd As String
    Dim sArgs As String
    sCmd = "/opt/homebrew/bin/php"
    sArgs = "/d/www/php/test.php hello"
    oShell.execute sCmd, sArgs, 1
    MsgBox "called"
End Sub

エラーメッセージ詳細

BASIC runtime error.
An exception occurred 
Type: com.sun.star.system.SystemShellExecuteException
Message: Attribute not found.