Hi All,
Below is the code for adding hyperlink in Excelsheet but its giving me error.
Code:
Imports Excel = Microsoft.Office.Interop.Excel
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
xlWorkBook = New Excel.Application().Workbooks.Open("C:\Practice.xls")
xlWorkSheet = xlWorkBook.ActiveSheet
xlWorkSheet.Cells(1, 1) = xlWorkSheet.Hyperlinks.Add(Anchor:="Selection", Address:="http://www.MySite.com", TextToDisplay:="Clickhere")
xlWorkBook.Save()
xlWorkBook.Close()
Is this the correct way to add hyperlink in Excel if not Can you please tell me how can i do that.
below part of the above code i have generated using 'macro' in excel.
Anchor:="Selection", Address:="
http://www.MySite.com", TextToDisplay:="Clickhere"
Thanks
Nelly