Create an Excel file using vbscripts

前端 未结 5 1396
清歌不尽
清歌不尽 2020-12-29 12:36

How do I create an excel file using VBScript? I searched the net but it just mentions opening an existing file.

This is the extraction from the Internet

5条回答
  •  不知归路
    2020-12-29 13:18

    set objExcel = CreateObject("Excel.Application")
    objExcel.Application.DisplayAlerts = False
    set objWorkbook=objExcel.workbooks.add()
    objExcel.cells(1,1).value = "Test value"
    objExcel.cells(1,2).value = "Test data"
    objWorkbook.Saveas "c:\testXLS.xls"
    objWorkbook.Close
    objExcel.workbooks.close
    objExcel.quit
    set objExcel = nothing `
    

提交回复
热议问题