运行程序wjdy1.prg打印期中考务安排.xls中的所有工作表
我想运行程序文件wjdy1.prg打印 期中考务安排.xls 中的所有工作表,下列程序只能打印第一张工作表,请高手帮忙,万分感谢!!!
期中考务安排.zip
(9.97 KB)
CLOSE ALL
CLEAR ALL
SET TALK OFF
SET SAFETY OFF
SET COMPATIBLE off
cCurrentProcedure=SYS(16,1)
nPathStart=AT(":",cCurrentProcedure)-1
nLenOfPath=RAT("\",cCurrentProcedure)-(nPathStart)
mypath=SUBSTR(cCurrentProcedure,nPathStart,nLenOfPath)
SET DEFAULT TO (mypath)
use temp1
SCAN
wjm=ALLTRIM(temp1.文件名)
oExcel=CREATEOBJECT("excel.application")
oExcel.workbooks.open(wjm)
oExcel.visible=.t.
oExcel.ActiveSheet.printout(1,5,1,.F.) && 这句代码如何修改?
oExcel.quit
RELEASE oExcel
ENDSCAN
return
[此贴子已经被作者于2018-11-14 14:22编辑过]