为什么excel的printout提示1004错误
错误原因是未安装打印机,可是我安装了并且试着打过几张
源代码如下,VBA写在一个asp页面中。
xlBook.Application.Visible = False
xlBook.Application.DisplayAlerts = False
'开始打印
err.clear
objExcel.ActiveSheet.PrintOut ' print Worksheet
if err.number<>0 then
'如果错误代码是1004,解决办法参考http://support.microsoft.com/default.aspx?scid=kb;en-us;Q148723
response.write "err.Description=" &err.Description & "err.source=" &err.source
stop
'goto errorHandle
end if
'!!!需要在这里增加提示用户正在打印的信息,因为打印有点慢
xlBook.close false
objExcel.close
exit sub