Solved

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

Posted on 2008-06-10
8
484 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
Comment Utility

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

Author Comment

by:mathieu_cupryk
Comment Utility
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
Comment Utility
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
 
LVL 29

Expert Comment

by:Gautham Janardhan
Comment Utility
discounts[rowCount - currRow, 0] = (double)cellvalue.Value2;
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:mathieu_cupryk
Comment Utility
double)cellvalue.Valuel;?
0
 
LVL 12

Expert Comment

by:renjurdevan
Comment Utility
double)cellvalue.Value;

or

double)cellvalue.Value2;
0
 

Author Comment

by:mathieu_cupryk
Comment Utility
which one is it in excel.
0
 
LVL 29

Accepted Solution

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

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
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 this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now