VBScript:写excel的例子

写excel demo:

Set app = wscript.createobject("Excel.application")
app.visible=True
Set workbook = app.workbooks.add

Set sheet = workbook.worksheets(1)
For row = 1 To 10
	For col = 1 To 5
		sheet.cells(row, col).value = rnd()
	Next
Next

Set sheet = workbook.worksheets(3)
sheet.range("A1:e10").formula = "=Sheet1!a1"
posted @ 2019-01-02 15:01  xuejianbest  阅读(226)  评论(0编辑  收藏  举报