none
How to read data fom excel RRS feed

  • Question

  • Hi 

    I have created a Button for excel at application level using VSTO. i mean whenever excel opens i have tht botton . now i want to read the content of the excel sheet tht is open whn any one clicks the button ... for example if cell A1 has value 1 i want to read tht value.
    can any body help me any article or code snippet


    Thanks 
    Avi 
    ;-) Cheers
    Friday, October 17, 2008 6:44 AM

Answers

  • The simplest sample - writes "Hello World into Cell A1:

     

    Excel.Workbook workbook = Globals.ThisAddIn.Application.Workbooks.Add(Missing.Value);

    Excel.Worksheet worksheet = (Excel.Worksheet)workbook.ActiveSheet ;

    Excel.Range range = worksheet.get_Range("A1:A1", Missing.Value);

    range.Value2 = "Hello World";




    Greets, Helmut Obertanner [http://www.x4u.de]
    Friday, October 17, 2008 7:14 AM
    Answerer