How to Read a Date from other sheet in C# with Excel?

Hi,

How do you read a data from other sheet in C# with Excel

In VB6 it was like sheet1.cells(1,2) = sheet2.cells(10,15)
How can it be in C#

sheet1.cells(1,2) = sheet2.cells(10,15)

Thanx for any idea.

Vahid Nourbin



Answer this question

How to Read a Date from other sheet in C# with Excel?

  • balaiitm

    Hi,

    what is code in C# :

    in VB6.0 :

    Dim intValue01 as Integer

    Dim strValue01 as String

    ...

    intValue01 = sheet1.cells(1, 1)

    strValue02 = sheet1.cells(1, 2)

    intValue01 = intValue01 + 2

    strValue02 = strValue02 + " is good "

    ...

    sheet2.cells(1,1) = intValue01

    sheet2.cells(1,2) = strValue02


  • devram

    Hi,

    Try using the CodeTranslatior.



  • rital

    Hi, tanks for ' Code Translation VB.NET and C# ' site . but i need this

    Code Translation from VBA6.0 (with Excel Application) to C# :


    Dim intValue01 as Integer

    intValue01 = sheet1.cells(1, 1)

    intValue01 = intValue01 + 2

    sheet2.cells(1,1) = intValue01


    Thanx for any idea.


  • Grzegorz Gogolowicz MSFT

    Hi,

    The code in C# is quite similar:

    Globals.Sheet1.Cells [1,2] = Globals.Sheet2.Cells [10,15]

    Hope this helps.



  • How to Read a Date from other sheet in C# with Excel?