VBScript で Excel OLE オートメーション シートの内容を取得する
Option Explicit Dim excelApp Set excelApp = CreateObject("Excel.Application") excelApp.Visible = True excelApp.DisplayAlerts = False '警告メッセージをOFF 'ブックを読み取り専用で開く Dim book Set book = excelApp.Workbooks.Open(WScript.Arguments(0), False, True) Dim sheet Set sheet = book.WorkSheets.Item(WScript.Arguments(1)) Dim row For Each row In sheet.Cells.CurrentRegion.Rows Dim col For Each col In row.Columns WScript.Echo col.Value Next Next excelApp.Quit Set excelApp = Nothing