if dir("d:/excel.bz") = "" then '判断excel是否打开 set xlapp = createobject("excel.application") '创建excel应用类 xlapp.visible = true '设置excel可见 set xlbook = xlapp.workbooks.open("d:/test.xls") '打开excel工作簿 set xlsheet = xlbook.worksheets(1) '打开excel工作表
application.cutcopymode = false for i = 1 to 9 range("a" & (i + 1)).select activecell.formular1c1 = "项目" & i range("b" & (i + 1)).select activecell.formular1c1 = i range("c" & (i + 1)).select activecell.formular1c1 = "说明" & i next