Forum Discussion

Funa's avatar
Funa
Copper Contributor
Dec 14, 2025

VBSでExcelを起動する事が出来ません。

助けて下さい。

このVBSで実行してもExcelが起動しません。
VB.NetやVB6でプログラムが組めず困っています。

よろしくお

願いします。

1 Reply

  • NikolinoDE's avatar
    NikolinoDE
    Platinum Contributor

    BS (Visual Basic Script) で Excelを起動できない場合は、ほとんどが スクリプトの書き方ExcelのCOM登録の問題です。
    順を追って確認していきましょう。

     

    基本のVBSでExcelを起動する例

    ' Excelを起動するVBSサンプル

    Dim xlApp

    Set xlApp = CreateObject("Excel.Application") ' Excelを起動

     

    If xlApp Is Nothing Then

        MsgBox "Excelを起動できませんでした。"

    Else

        xlApp.Visible = True ' Excelを画面表示

        MsgBox "Excelが起動しました!"

    End If

    上記を test.vbs として保存して実行します。

     

    よくある原因と対策

    (1) Excelがインストールされていない / COM登録されていない

    • ExcelがPCに入っているか確認
    • 32bit/64bitの不一致も注意(32bitのExcelに64bit VBSだと失敗する場合があります)

    対策

    • Excelを修復
    • コントロールパネル → プログラムの修復 → Microsoft 365 / Office → 修復
    •  

    この文章はソフトウェアによって翻訳されました。ユーザーはこの言語を理解できません。

     

    My answers are voluntary and without guarantee!

    Hope this will help you.

    Was the answer useful? Mark as best response and like it!

    This will help all forum participants.

Resources