Extracting a URL from hyperlinked text in Excel cell

前端 未结 8 2316
孤街浪徒
孤街浪徒 2020-12-17 23:43

I have a table full of Hyperlinked text in excel, so it\'s basically a bunch of names but when I click on one, it takes me to some URL in my default browser.

So I am

8条回答
  •  一向
    一向 (楼主)
    2020-12-18 00:14

    I just ran into this issue and this is what worked for me:

    I used the FormulaR1C1 extension method for a range. So my code looked like this:

                        for (int r = 2; r <= sheetRange.Rows.Count; r++)
                        {
                            documentRecord = new List();
                            for (int c = 1; c <= wkCol; c++)
                            {
                                documentRecord.Add(sheetRange.Cells[r, c].FormulaR1C1); 
                            }
                            AllRecords.Add(documentRecord);
                        }
    

    When the record is added to the list of records, the value of whatever the cell range was is formatted into a clickable-hyperlink.

提交回复
热议问题