This statement fails:
wb = (Excel._Workbook)(books.Open(_sourceFilename, 0, true, missing, missing,
missing, true, missing, missing, missing, missing,
missing, missing, missing, missing));
with error:
System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office 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.
at Microsoft.Office.Interop.Excel.Workbooks.Open(String Filename, Object UpdateLinks, Object ReadOnly, Object Format, Object Password, Object WriteResPassword, Object IgnoreReadOnlyRecommended, Object Origin, Object Delimiter, Object Editable, Object Notify, Object Converter, Object AddToMru, Object Local, Object CorruptLoad)
The solution is an odd one: create the directory "C:\Windows\SysWOW64\config\systemprofile\Desktop".
That's it. Works like a charm.
perfectly works..
ReplyDeletethnx
For 32 bit systems create the following directory
ReplyDeleteC:\Windows\System32\config\systemprofile\Desktop
Awesome!!!
ReplyDeleteGreat...
ReplyDeleteit works fine for me!! Thanks!!
ReplyDeleteI'm very very thank you.
ReplyDeleteYou solve my problem.
Thanks again.
Merry Christmas.
Happy New Year
But why?
ReplyDeleteI'd like to know why also? does anyone know?
DeleteThanks I was able to open the excel work book .Earlier it was giving this error. But how did it work ???
ReplyDeleteI got another error
-The remote procedure call failed. (Exception from HRESULT: 0x800706BE)
Please Help
Hi, i have the same issue, did you solve it?
DeleteThanks in advance
Worked! Thumbs up :)
ReplyDeleteAdditionally, you may need to grant the account that whatever your system is running as full control to that folder. We had a windows service account that was trying to access that folder and this didn't work until we granted the service account full control to that folder.
ReplyDeleteHI, I have had the same problem on the follow scenario: WINDOWS 7 64bit, Office 2010 32bit. With a consele application that call an instance of excel I obtain the same error. I follow your suggest and now is ok. I would to know why Excel on this scanario need of DESKTOP folder. Please it is form me very important.
ReplyDeleteTy i dont know what i did but it works!!!
ReplyDeleteGreat!!!! It works, but how did you figure it out in the first place. It makes not logical sense. :-)
ReplyDeletethnx a lot
ReplyDeleteit works fine.......
its magic....:)
I can't believe this actually fixes the issue!
ReplyDeleteThanks!!!
OMG !!! Great !!!!! Thanks a lot !!!!!! It works for me !!! Thanks Thanks !!!! (I have lost 1 week for this bug)
ReplyDeleteI would love to know WHY this works but the fact that it works at all is enough for now :)
ReplyDeleteThanks
This is still working! :)
ReplyDeleteThanks!
Great!!! it works :)
ReplyDeletei am still getting error
ReplyDeleteGreat It works :)
ReplyDeleteIt is now the end of 2015... and this still works. I only got this error after publishing to a new server. I tried the index remedy, permissions issues, even tried to place the file locally on the new server. Nada. but this damn folder solved my issue and now I can roll out my software to the team! Thank you so much! (no seriously, if I could hug you I would)
ReplyDeleteI am still getting this error. Created Desktop folder as said, given all permissions. I am on Windows Server 2012
ReplyDeleteIts June 2016, I have the same problem, and created the Desktop directory, but didn't solve the problem. Do I need a reboot?
ReplyDeleteUsing Windows10, 64-bit. Excel 2013
My Microsoft.Office.Interop.Excel dll is pretty old v2.0.50727 (Jan 18,2011), but has worked in May 2016. Just stopped working last week.
Any insight would be appreciated
Thank you so much.....It worked like charm...Many thanks
ReplyDelete