Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am getting the above error. Please give me a solution.

What I have done so far,
1) Added Excel.dll and ICSharpCode.SharpZipLib.dll
2) Included namespaces using Excel and using ICSharpCode.SharpZipLib
3) On file upload button click,
C#
protected void btnUpload_Click(object sender, EventArgs e)
   {
       string xFilePath = fuAlumniList.PostedFile.FileName;
       IExcelDataReader excelReader = null;
       FileStream stream = null;
   }

Eventhough I have only this much of code,while I try to upload an excel file I am getting the error,
"Could not load file or assembly 'Excel, Version=2.1.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa' or one of its dependencies. The system cannot find the file specified"


I am using Windows Server 2008 R2 (64-bit OS) and MS Office (32 bit)


[edit]code block added[/edit]
Posted
Updated 13-Nov-12 20:14pm
v6

1 solution

Make sure the Excel.dll and all other referenced dll's are beside your executable code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900