Reading Excel Cells

Hi,

I am trying to read an Excel spreadsheet which is working fine if I specify actual cell locations but each cell in the spreadsheet is named as well (created by someone to look like a form as they weren't conversant with Access or VB).

How can I tell my VB application to find a specific cell by the name instead of the location as some spreadsheets are slightly different, in that the cells are not always in exactly the same place (although the names are the same).


In addition, I'm using "worksheet.cells(1,8).value" which works fine, but "worksheet.cells(1,8).name" or "......(1,8).comment" doesn't work.

Assistance would be greatly appreciated!

Mark


Answer this question

Reading Excel Cells

  • vinoth.net

    There is much discussion of this sort of thing in a new <a href="http://msdn.microsoft.com/library/en-us/odc_vsto2003_ta/html/ExcelObj.asp">white paper</a> posted on Microsoft's site. You might check out the discussion of programming Excel from a .NET perspective there. It's hard to tell exactly what kind of problems you're having here, but it sounds like you're trying to use named ranges, and that's covered in the article.
  • Reading Excel Cells