我尝试使用此代码创建一个 Excel 工作表。
Set ExcelObject = CreateObject("Excel.Application")
ExcelObject.visible = True
ExcelObject.WorkBooks.Add
ExcelObject.Sheets(1).Cells(1,1).value = "My first excel"
但我想要生成不止一个 excel 所以我尝试了这段代码-
Set ExcelObject = CreateObject("Excel.Application")
For x= 1 to 5
ExcelObject(x).visible = True
ExcelObject(x).WorkBooks.Add 'Adds a workbook to an excel object
x=x+1
ExcelObject.Sheets(1).Cells(1,1).value = "My first excel"
但它不起作用。请帮忙!