使用 vbscripts 创建 Excel 文件 [英] Create an Excel file using vbscripts
本文介绍了使用 vbscripts 创建 Excel 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用 VBScript
创建 Excel 文件?我在网上搜索,但它只是提到打开一个现有文件.
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 shown below
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Scripts\New_users.xls")
我想知道你如何使用vbscript
创建一个新的excel文件或.xls
?
I want to know how do you create a new excel file or .xls
using vbscript
?
感谢和问候
麦迪
推荐答案
这里是示例代码
strFileName = "c:\test.xls"
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Add()
objWorkbook.SaveAs(strFileName)
objExcel.Quit
这篇关于使用 vbscripts 创建 Excel 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文