Aug 3, 2015

Cannot open Excel file in C#

while working on "Open excel file" from application using C# or VB.net...
you may get below exception in exception handler..
Exception:
Excel cannot access the file 'c:\demofolder\demo.xls'. 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.
or below message :

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.

Solution 
Operating system:

Windows 2008 Server x64 :
Go to the below path and Create a "Desktop" folder
C:\Windows\SysWOW64\config\systemprofile\

Windows 2008 Server x86 :
Go to the below path and Create a "Desktop" folder
C:\Windows\System32\config\systemprofile\

There are other also other ways to resolve this problem by modifying the Registry of MS Office Excel to make the files available which is not suggested.

No comments:

Post a Comment

Thank you.