作者在 2021-04-11 21:04:05 发布以下内容
LOCAL lOldSetOpt,mChanNum
lOldSetOpt = DDESetOption("SAFETY")
= DDESetOption("SAFETY",.F.)
mChanNum = DDEInitiate('Excel', 'SYSTEM') &&EXCEL是否已经打开
IF mChanNum # -1
= MESSAGEBOX('程序 EXCEL 已经打开,请先将其关闭!', 64, '系统提示!')
= DDETerminate(mChanNum)
= DDESetOption("SAFETY",lOldSetOpt)
RETURN
ELSE
*copy to xxx.xls
ENDIF