Extracting a URL from hyperlinked text in Excel cell

前端 未结 8 2333
孤街浪徒
孤街浪徒 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:03

    In your code just add

    string myString = ((Excel.Range)xlws.Cells[2, 1]).Cells.Hyperlinks[1].Address;
    

    I obviously recommend doing some checks before accessing the "Hyperlinks" property.

提交回复
热议问题