Solved

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

Posted on 2008-06-10
8
489 Views
Last Modified: 2013-12-17
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;


                   
0
Comment
Question by:mathieu_cupryk
  • 3
  • 3
  • 2
8 Comments
 
LVL 12

Expert Comment

by:renjurdevan
ID: 21756912

discounts[rowCount - currRow, 0]  = (double)cellvalue.Value;
0
 

Author Comment

by:mathieu_cupryk
ID: 21756923
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
 
LVL 12

Expert Comment

by:renjurdevan
ID: 21756937
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
The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 21756951
discounts[rowCount - currRow, 0] = (double)cellvalue.Value2;
0
 

Author Comment

by:mathieu_cupryk
ID: 21756958
double)cellvalue.Valuel;?
0
 
LVL 12

Expert Comment

by:renjurdevan
ID: 21756967
double)cellvalue.Value;

or

double)cellvalue.Value2;
0
 

Author Comment

by:mathieu_cupryk
ID: 21756977
which one is it in excel.
0
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 500 total points
ID: 21757015
(double)cellvalue.Value2;
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question