Hyperlink without Excel Application Scope

Hello,

I need solution how to do hyperlink in excel file without using Excel Application Scope. Maybe with invoke code, but I need the code.
Please help!

Hey!

Try like this:

<a href>link text</a>

Just we need to add the starting tag and ending tag to the value…

Regards,
NaNi

Hello,

thank you, but could you explain with more details, because I don’t get it. Is this code for invoke code activity? Where is this starting tag and ending tag? What exactly I have to do? Thanks in advance

Hey!

follow the steps…

  1. Read the Excel-DtOut
  2. Take one for each row in DataTable
  3. Take one assign activity create a string variable
  4. Pass the value like this in the Assign
Assign HyperLink = "<a href>"+CurrentRow(ColumnName).ToString.Trim+"</a>"

Where the columnName: Your hyperlink column

Take one add data row

in the ArrayOfRow mention like this

{CurrentRow(0).ToString,CurrentRow(1).ToString....}

The columns must match with the temp Column position

Regards,
NaNi

Thanks

But the result in excel is not what i expect. It’s just the file path with a href in front and /a in the back of the path

Hello @Denislav_Vladimirov
Please refer to the below post. It discussed the same requirement.

Hello,

I know this post, I use this solution in my process, but I have issue with it :slight_smile: My question is how i can do hyperlink WITHOUT excel application scope, because of this issue. In this post they make it with excel application scope.
My process stuck sometimes without any error on this step with excel app scope and i read in the forum it’s because this activity (this activity checks the license of the excel and sometimes it take a while and process stuck without any error because is already on the next step), that’s why i need some other solution.

Could you try the same with workbook activities?

Thanks for suggestion, but I’ve tried this and not working :frowning:

How about using excel function HYPERLINK?

=HYPERLINK("http://example.domain.com/link/to/open/index.html")

Cheers

What is the error you are getting?

Hello,

Thank, but is what i’m doing right now and I looking for other option, because like I said i have issue with it

There is no error, just is the first hyperlink to all rows down

You wrote you have problem when using “Excel Application Scope”
But you do not need to use “Excel Application Scope”
You could use Workbook activity WriteCell

image

Cheers

Are you getting the same hyperlink in all rows? Then it could be your loop which is creating issue. The formula should work otherwise. Can you explain how you are looping through to put different hyperlinks?

I tried the same thing but the formula is getting pasted as it is in the rows.
but if we open excel, click on the formula cell and hit “enter”, the cell converts to hyperlink.

the formula is correct.
it is getting written correctly as well.
but whole formula is getting written as plain text instead of hyperlink.
I am using workbook activities, maybe that’s a limitation.

Hope this helps

Dim excelApp As Microsoft.Office.Interop.Excel.Application = New Microsoft.Office.Interop.Excel.Application()
Dim workbook As Microsoft.Office.Interop.Excel.Workbook = excelApp.Workbooks.Open(“YourExcelFilePath.xlsx”)
Dim worksheet As Microsoft.Office.Interop.Excel.Worksheet = workbook.Sheets(“Sheet1”)
Dim cell As Microsoft.Office.Interop.Excel.Range = worksheet.Range(“A1”)
Dim hyperlink As Microsoft.Office.Interop.Excel.Hyperlink = worksheet.Hyperlinks.Add(cell, “https://www.example.com”)
hyperlink.TextToDisplay = “Click Here”
workbook.Save()
workbook.Close()
excelApp.Quit()

Remember to have the Microsoft Office Interop library installed and referenced in your project for the code to work properly.

This is result of my test using approach described above. It acts as hyperlink. Only “issue” is that it is not formated as hyperlink (i.e. not underlined).

Cheers

Hope this helps.

Dim excelApp As Microsoft.Office.Interop.Excel.Application = New Microsoft.Office.Interop.Excel.Application()
Dim workbook As Microsoft.Office.Interop.Excel.Workbook = excelApp.Workbooks.Open(“YourExcelFilePath.xlsx”)
Dim worksheet As Microsoft.Office.Interop.Excel.Worksheet = workbook.Sheets(“Sheet1”)
Dim cell As Microsoft.Office.Interop.Excel.Range = worksheet.Range(“A1”)
Dim hyperlink As Microsoft.Office.Interop.Excel.Hyperlink = worksheet.Hyperlinks.Add(cell, “https://www.example.com”)
hyperlink.TextToDisplay = “Click Here”
cell.Font.Underline = True
cell.Font.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Blue)
workbook.Save()
workbook.Close()
excelApp.Quit()