discounts[rowCount - currRow, 0] = (int)cellvalue.Value2; excel from vb.net to c#

What is the conversion from vb.net to c#
discounts(rowCount - currRow, 0) = CDbl(cellvalue.Value)

is it

 discounts[rowCount - currRow, 0] = (int)cellvalue.Value2;


                   
mathieu_cuprykAsked:
Who is Participating?
 
Gautham JanardhanConnect With a Mentor Commented:
(double)cellvalue.Value2;
0
 
renjurdevanCommented:

discounts[rowCount - currRow, 0]  = (double)cellvalue.Value;
0
 
mathieu_cuprykAuthor Commented:
Error      2      Property, indexer, or event 'Value' is not supported by the language; try directly calling accessor methods 'Microsoft.Office.Interop.Excel.Range.get_Value(object)' or 'Microsoft.Office.Interop.Excel.Range.set_Value(object, object)'      C:\Users\Aministrator\Desktop\InitialPriceReporting\InitialPriceReporting\DotNet\InitialPriceReportingSpreadsheet\Program.cs      113      77      InitialPriceReportingSpreadsheet

it does not see value it sees value2
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
renjurdevanCommented:
i assume discount is array rather than function

if it is function and using for comparison then code will looks like

discounts(rowCount - currRow, 0) == (double)cellvalue.Valuel;
0
 
Gautham JanardhanCommented:
discounts[rowCount - currRow, 0] = (double)cellvalue.Value2;
0
 
mathieu_cuprykAuthor Commented:
double)cellvalue.Valuel;?
0
 
renjurdevanCommented:
double)cellvalue.Value;

or

double)cellvalue.Value2;
0
 
mathieu_cuprykAuthor Commented:
which one is it in excel.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.