I need to get the exact link inside the formula(HYPERLINK) and save it to the database. here is my code to get the link,
answerList.Add(new SurveyCompetitorAnswer
{
MainSurveyId = id,
Answer = workSheet.Cells[AnswerRowRange].Text,
DateCreated = DateTime.Now,
Link = workSheet.Cells[AnswerRowRange].Formula,
SurveyQuestionId = item.Id,
SurveyCompetitorId = comp.Id
});
but it get the whole FORMULA text. example (HYPERLINK("https://www.owler.com/company/sproutsolutions","0.5"))
...
what I need is just https://www.owler.com/company/sproutsolutions.
I tried using Link = workSheet.Cells[AnswerRowRange].Hyperlink,
but its purpose is only to SET links and not GET links.
EDIT: I tried using var link = workSheet.Cells[AnswerRowRange];
and Link = link.Hyperlink.AbsoluteUri
, but it shows null reference exception