Results 1 to 6 of 6

Thread: [Excel, C#2005] Getting Cell From CellName

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Quasar6's Avatar
    Join Date
    Mar 2008
    Location
    Sol 3
    Posts
    325

    [Excel, C#2005] Getting Cell From CellName

    I'm using the Excel Interop to input a number of strings into cells. The cells can change depending on the excel "template" I open.

    The cell names are constant however: the template file will always have a number of input cells with specific names.

    What I need to do (In Visual C#, 2005) is get the specific cell in the worksheet from a name I specify in the code, and change it's value.

    So far I have the following set up:
    Code:
    Excel.Application oXLApp = new Excel.Application();
                oXLApp.Visible = true;
                Excel.Workbook oXLBook = oXLApp.Workbooks.Open(
                  Application.StartupPath + "\\Template1.xls", 
                  openFileDialog1.FileName, 0, true, 5,
                  "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false,
                  0, true);
                Excel.Worksheet oSht = (Excel.Worksheet)oXLBook.Worksheets.get_Item(1);
    From there I'm not sure where to go. Any help would be appreciated.
    Qu.
    Last edited by Quasar6; Aug 27th, 2008 at 08:56 PM. Reason: Add more info to title
    "Why do all my attempts at science end with me getting punched by batman?" xkcd.

    |Pong||
    Sorry for not posting more often.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width