Rama Tito
asked on
Excel could not be found - missing assembly reference?
Hi, I did get this error in my error list while compiling the project. Previously the project are done with MS Office Excel 2003, and currenlty i am using Excel 2007. In my system i don't have MS office 2003. In my project, my references i did add Excel and Microsoft.Office.Core.
The error is ->
The type or namespace name 'Excel' could not be found (are you missing a using directive or an assembly reference?)
private int findColumnDept(Excel.Works heet Ws)
Error was underline in "Excel"
The error is ->
The type or namespace name 'Excel' could not be found (are you missing a using directive or an assembly reference?)
private int findColumnDept(Excel.Works
Error was underline in "Excel"
private int findColumnDept(Excel.Worksheet Ws)
{
int no=1;
string CellValue="";
int retryCount=0;
bool EmptyCellAllowed=true;
do
{
//listBox1.Items.Add(worksheet.getCells[i,1].ToString());
Excel.Range range1 = Ws.get_Range( "A"+no, "A" + no);
no++;
if (range1.Cells.Value2!=null)
{
CellValue=range1.Cells.Value2.ToString().Trim();
EmptyCellAllowed=false;
}
else
{
retryCount++;
CellValue="";
if (retryCount>15)
{
EmptyCellAllowed=false;
no=0;
}
}
}while ((CellValue.Length>0)||(EmptyCellAllowed)) ;
return no-1;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
glad to help you
ASKER
using Excel = Microsoft.Office.Interop.E
Thank you.