自宅で使っている表計算ソフトは「JUST Calc」だったりします。
JUST Calc を使用して、表計算ファイル(xlsx) のすべてのシートを PDF出力するには、以下のように…。
set args = Wscript.Arguments
If args.Count = 0 Then
Wscript.Quit(-1)
End If
set app = CreateObject("JustCalc.Application")
app.Workbooks.Open args(0), 0
set book = app.ActiveWorkbook
For Each ws In app.Worksheets
path = book.Path & "\" & ws.Name & ".pdf"
ws.ExportAsFixedFormat 0, path, 0
Next
book.Close
set args = Nothing
set book = Nothing
set app = Nothing
このファイルを outputPdf.vbs として以下のように使う。
cscript outputPdf.vbs "c:\xxx.xlsx"
もちろん、Excel ならば、JustCalc.Application のところを、Excel.Application かな? に変更すれば大丈夫のはず。Excel 持ってないので分かりませんが…。
コメント