Microsoft Excel 不能訪問文件"C:\Users\james\Documents\test.xls"。 可能的原因有以下幾個:
• 文件名稱或路徑不存在。
• 文件正被其他程序使用。
• 您正要保存的工作簿與當前打開的工作簿同名。
用Quartz.Net寫了個服務,實現將office文檔轉PDF功能。發布到Windows Server 2008 出現上述錯誤。
google之:
Windows 2008 Server x64
Please make this folder.
C:/Windows/SysWOW64/config/systemprofile/Desktop
Windows 2008 Server x86
Please make this folder.
C:/Windows/System32/config/systemprofile/Desktop
...instead of dcomcnfg.exe.
This operation took away office automation problems in my system.
A Desktop folder seems to be necessary in the systemprofile folder to open file by Excel.
It disappears from Windows2008, Windows2003 had the folder,
and I think it cause this error.
即在C:/Windows/System32/config/systemprofile和C:/Windows/SysWOW64/config/systemprofile目錄下創建名為Desktop目錄即可解決問題