Solved

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

Posted on 2008-06-10
8
485 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
 
LVL 29

Expert Comment

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

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

932 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

12 Experts available now in Live!

Get 1:1 Help Now