I have my code as follows :-
Microsoft.Office.Interop.Excel.Application oXL = null;
Microsoft.Office.Interop.Excel.Sheets sheets;
Application excel = new Mic
Let me note that in my place, adding the c:\windows\syswow64\config\systemprofile\desktop directory didn't work.
The point is that WOW64 stands for Windows on Windows64, that means it actually applies for 32-bit programs running on the 64bit OS.
Since I have 64-bit Excel installed, the proper directory turned out to be the c:\windows\system32\config\systemprofile\desktop
I was previously attempt this problem then i resolved.
Solution:
I put the full permission to particular folder(Sub folder and files) and checked working fine.
This works
excel.exe /safe
This does not and gives the same error as the regular excel startup
excel.exe /automation
This also occurs for all MS Office 2007 apps for ANY network file. Local file access is fine.
I've wrapped my WCF in a Windows Service. Creating the Desktop Folders did solve it for me on one machine, but not on another.
My problem in the end was, that my Windows Service did not run under an active User of the machine. Configuring the service to run under a user which is active on the machine solved this problem for me so far.
Only the combination of
got it working for me.
This article lead me to the full solution: Cannot access excel file
Try this:
C:\Windows\SysWOW64\config\systemprofile\Desktop
(for the 32-bit version of Excel/Office on a 64-bit Windows computer) or
C:\Windows\System32\config\systemprofile\Desktop
(for a 32-bit version of Office on a 32-bit Windows computer or a 64-bit version of Office on a 64-bit Windows computer).
Original post with answer:
In my case, I followed the suggestions provided here and solved the problem.
Steps:
dcomcnfg
In step 2, if you can't locate that path then try running mmc comexp.msc /32
instead of dcomcnfg
.