Create an Excel file using vbscripts

前端 未结 5 1388
清歌不尽
清歌不尽 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:40

    Here is a sample code

    strFileName = "c:\test.xls"
    
    Set objExcel = CreateObject("Excel.Application")
    objExcel.Visible = True
    
    Set objWorkbook = objExcel.Workbooks.Add()
    objWorkbook.SaveAs(strFileName)
    
    objExcel.Quit
    

提交回复
热议问题