local script = [[ Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True Set objBook = objExcel.WorkBooks.Add() objExcel.Cells(1,1).Value = "val 1" objExcel.Cells(1,2).Value = "val 2" objBook.SaveAs "%s" objBook.Close objExcel.Quit Set objExcel = Nothing Set objWorkbook = Nothing ]] local fn = [[E:\vbsTest.xlsx]] local tmp = IO.Path.GetTempFileName() tmp = IO.Path.ChangeExt(tmp,"vbs") writefile(tmp,script:format(fn)) ShellExecute(tmp) ShellExecute(fn)