mathieu_cupryk
asked on
Easy syntax fixing. C#
I converted some code :
cellvalue = (Microsoft.Office.Interop. Excel.Rang e)inputRan ge.Cells(r owCount, pricesColumn);
if (Strings.Len(cellvalue.Val ue) > 0)
{
if (cellvalue.Value.ToString == "Stones" | cellvalue.Value.ToString == "Tough")
{
// all prices have been read
currRow = rowCount + 1;
// skip a row to where the discounts are
break; // TODO: might not be correct. Was : Exit For
}
Price = (double)cellvalue.Value;
cellvalue = (Microsoft.Office.Interop. Excel.Rang e)inputRan ge.Cells(r owCount, 15);
gradeName = cellvalue.Value.ToString;
Insert_Price_List_Detail(g radeName, Price);
// insert the prices
}
Error 1 No overload for method 'Open' takes '1' arguments C:\Users\Aministrator\Desk top\Initia lPriceRepo rting\Init ialPriceRe porting\Do tNet\Initi alPriceRep ortingSpre adsheet\Pr ogram.cs 46 1 InitialPriceReportingSprea dsheet
Error 2 'Microsoft.Office.Interop. Excel.Rang e.Cells' is a 'property' but is used like a 'method' C:\Users\Aministrator\Desk top\Initia lPriceRepo rting\Init ialPriceRe porting\Do tNet\Initi alPriceRep ortingSpre adsheet\Pr ogram.cs 70 82 InitialPriceReportingSprea dsheet
Error 3 The name 'Strings' does not exist in the current context C:\Users\Aministrator\Desk top\Initia lPriceRepo rting\Init ialPriceRe porting\Do tNet\Initi alPriceRep ortingSpre adsheet\Pr ogram.cs 71 25 InitialPriceReportingSprea dsheet
Error 4 Property, indexer, or event 'Value' is not supported by the language; try directly calling accessor methods 'Microsoft.Office.Interop. Excel.Rang e.get_Valu e(object)' or 'Microsoft.Office.Interop. Excel.Rang e.set_Valu e(object, object)' C:\Users\Aministrator\Desk top\Initia lPriceRepo rting\Init ialPriceRe porting\Do tNet\Initi alPriceRep ortingSpre adsheet\Pr ogram.cs 71 47 InitialPriceReportingSprea dsheet
Error 5 Property, indexer, or event 'Value' is not supported by the language; try directly calling accessor methods 'Microsoft.Office.Interop. Excel.Rang e.get_Valu e(object)' or 'Microsoft.Office.Interop. Excel.Rang e.set_Valu e(object, object)' C:\Users\Aministrator\Desk top\Initia lPriceRepo rting\Init ialPriceRe porting\Do tNet\Initi alPriceRep ortingSpre adsheet\Pr ogram.cs 73 39 InitialPriceReportingSprea dsheet
Error 6 Property, indexer, or event 'Value' is not supported by the language; try directly calling accessor methods 'Microsoft.Office.Interop. Excel.Rang e.get_Valu e(object)' or 'Microsoft.Office.Interop. Excel.Rang e.set_Valu e(object, object)' C:\Users\Aministrator\Desk top\Initia lPriceRepo rting\Init ialPriceRe porting\Do tNet\Initi alPriceRep ortingSpre adsheet\Pr ogram.cs 73 78 InitialPriceReportingSprea dsheet
Error 7 Property, indexer, or event 'Value' is not supported by the language; try directly calling accessor methods 'Microsoft.Office.Interop. Excel.Rang e.get_Valu e(object)' or 'Microsoft.Office.Interop. Excel.Rang e.set_Valu e(object, object)' C:\Users\Aministrator\Desk top\Initia lPriceRepo rting\Init ialPriceRe porting\Do tNet\Initi alPriceRep ortingSpre adsheet\Pr ogram.cs 80 51 InitialPriceReportingSprea dsheet
Error 8 'Microsoft.Office.Interop. Excel.Rang e.Cells' is a 'property' but is used like a 'method' C:\Users\Aministrator\Desk top\Initia lPriceRepo rting\Init ialPriceRe porting\Do tNet\Initi alPriceRep ortingSpre adsheet\Pr ogram.cs 81 86 InitialPriceReportingSprea dsheet
Error 9 Property, indexer, or event 'Value' is not supported by the language; try directly calling accessor methods 'Microsoft.Office.Interop. Excel.Rang e.get_Valu e(object)' or 'Microsoft.Office.Interop. Excel.Rang e.set_Valu e(object, object)' C:\Users\Aministrator\Desk top\Initia lPriceRepo rting\Init ialPriceRe porting\Do tNet\Initi alPriceRep ortingSpre adsheet\Pr ogram.cs 82 47 InitialPriceReportingSprea dsheet
from vb.net but
i have errors.
can someone help me out.
cellvalue = (Microsoft.Office.Interop.
if (Strings.Len(cellvalue.Val
{
if (cellvalue.Value.ToString == "Stones" | cellvalue.Value.ToString == "Tough")
{
// all prices have been read
currRow = rowCount + 1;
// skip a row to where the discounts are
break; // TODO: might not be correct. Was : Exit For
}
Price = (double)cellvalue.Value;
cellvalue = (Microsoft.Office.Interop.
gradeName = cellvalue.Value.ToString;
Insert_Price_List_Detail(g
// insert the prices
}
Error 1 No overload for method 'Open' takes '1' arguments C:\Users\Aministrator\Desk
Error 2 'Microsoft.Office.Interop.
Error 3 The name 'Strings' does not exist in the current context C:\Users\Aministrator\Desk
Error 4 Property, indexer, or event 'Value' is not supported by the language; try directly calling accessor methods 'Microsoft.Office.Interop.
Error 5 Property, indexer, or event 'Value' is not supported by the language; try directly calling accessor methods 'Microsoft.Office.Interop.
Error 6 Property, indexer, or event 'Value' is not supported by the language; try directly calling accessor methods 'Microsoft.Office.Interop.
Error 7 Property, indexer, or event 'Value' is not supported by the language; try directly calling accessor methods 'Microsoft.Office.Interop.
Error 8 'Microsoft.Office.Interop.
Error 9 Property, indexer, or event 'Value' is not supported by the language; try directly calling accessor methods 'Microsoft.Office.Interop.
from vb.net but
i have errors.
can someone help me out.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Error 4 Property, indexer, or event 'Value' is not supported by the language; try directly calling accessor methods 'Microsoft.Office.Interop. Excel.Rang e.get_Valu e(object)' or 'Microsoft.Office.Interop. Excel.Rang e.set_Valu e(object, object)' C:\Users\Aministrator\Desk top\Initia lPriceRepo rting\Init ialPriceRe porting\Do tNet\Initi alPriceRep ortingSpre adsheet\Pr ogram.cs 81 47 InitialPriceReportingSprea dsheet
if (cellvalue.Value.ToString( ) == "Stones" | cellvalue.Value.ToString() == "Tough")
if (cellvalue.Value.ToString(
ASKER
Error 9 'Microsoft.Office.Interop. Excel.Rang e.Cells' is a 'property' but is used like a 'method' C:\Users\Aministrator\Desk top\Initia lPriceRepo rting\Init ialPriceRe porting\Do tNet\Initi alPriceRep ortingSpre adsheet\Pr ogram.cs 92 86 InitialPriceReportingSprea dsheet
cellvalue = ((Microsoft.Office.Interop .Excel.Ran ge)inputRa nge).Cells (rowCount, 15);
another error
cellvalue = ((Microsoft.Office.Interop
another error
ASKER
Error 9 Property, indexer, or event 'Value' is not supported by the language; try directly calling accessor methods 'Microsoft.Office.Interop. Excel.Rang e.get_Valu e(object)' or 'Microsoft.Office.Interop. Excel.Rang e.set_Valu e(object, object)' C:\Users\Aministrator\Desk top\Initia lPriceRepo rting\Init ialPriceRe porting\Do tNet\Initi alPriceRep ortingSpre adsheet\Pr ogram.cs 92 47 InitialPriceReportingSprea dsheet
gradeName = cellvalue.Value.ToString() ;
gradeName = cellvalue.Value.ToString()
ASKER
I got some done.
if (Strings.Len(cellvalue.Val ue2) > 0)
{
if (cellvalue.Value2.ToString () == "Stones" | cellvalue.Value2.ToString( ) == "Tough")
{
// all prices have been read
currRow = rowCount + 1;
// skip a row to where the discounts are
break; // TODO: might not be correct. Was : Exit For
}
Price = Int32.Parse(cellvalue.Valu e2.ToStrin g());
cellvalue.Value2 = Cells[rowCount, 15];
gradeName = cellvalue.Value2.ToString( );
Insert_Price_List_Detail(g radeName, Price);
// insert the prices
}
is this ok?
if (Strings.Len(cellvalue.Val
{
if (cellvalue.Value2.ToString
{
// all prices have been read
currRow = rowCount + 1;
// skip a row to where the discounts are
break; // TODO: might not be correct. Was : Exit For
}
Price = Int32.Parse(cellvalue.Valu
cellvalue.Value2 = Cells[rowCount, 15];
gradeName = cellvalue.Value2.ToString(
Insert_Price_List_Detail(g
// insert the prices
}
is this ok?
do you have compiler error messages?
ASKER
cellvalue = ((Microsoft.Office.Interop
i am stuck on this.