当weistock已存在或者已打开的时候objexcel.ActiveWorkbook.SaveAs "e:\weistock.xls"会出错中断,请问如何从处理
dim fso,f1
set fso = Createobject("scripting.filesystemobject")
if fso.fileexists("e:\weistock.xls") = then
Set f1 = fso.GetFile("e:\weistock.xls")
'删除文件。
f1.Delete
end if
'以上代码检测是否存在"e:\weistock.xls",存在就删除,这样,你保存时就不会出问题了。