环境:Win2008R2, Excel2010
c# 写的Windows service,本地直接跑,一切正常,发布安装后,log中提示
System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Excel cannot access the file .
There are several possible reasons:
• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook.
解决方法:
1. 任务管理器中关闭所有Excel进程
2. 打开组件服务,cmd中敲dcomcnfg
3. 依次展开 控制台根节点--组件服务--计算机--我的电脑--DCOM配置,找到Microsoft Excel Application
4. 右键属性-标示 选择运行此应用程序的帐户中选中“交互式用户”,确定
-------------------------------------------------------
有人说建文件夹即可,不过我的环境下试了没用
・Windows 2008 Server x64
C:\Windows\SysWOW64\config\systemprofile\Desktop
・Windows 2008 Server x86
C:\Windows\System32\config\systemprofile\Desktop
-------------------------------------------------------------
浙公网安备 33010602011771号