Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
gerhardl
Creator II
Creator II

Add hyperlink to excel via macro

Hi there,

I have a macro that generates an Excel Report.

Any idea how I can add a hyperlink to another sheet in a specific cell?

5 Replies
marcus_sommer

This worked:

=HYPERLINK("#Navigation!A18";"Zurück zur Navigation")

- Marcus

gerhardl
Creator II
Creator II
Author

I had to change it a bit - not sure why that didn't work for me. I must be doing something different to you.

This works for me:

XLSheet1.Range("A20").Formula = "=HYPERLINK(""#Detail!A1"",""Click Me"")"

Thanks for getting me on the right path.

Andrea_Ghirardello

sub Create_HyperLink_Workbook

Dim v1, v2

Dim xlApp

Dim wbTarget

Dim tgtWorksheet

  set v1 = ActiveDocument.Variables("Output_Path")

  set v2 = ActiveDocument.Variables("Output_FileName")

  'initialize

  set xlApp = CreateObject("Excel.Application")

  xlApp.visible = False

  xlApp.ScreenUpdating = False

  xlApp.DisplayAlerts=false

  xlApp.Workbooks.Add

  Set wbTarget = xlApp.Workbooks(1)

  wbTarget.SaveAs (v1.getcontent.string & "\" & v2.getcontent.string)

  

  set tgtWorksheet = wbTarget.worksheets("Sheet1")

  tgtWorksheet.Hyperlinks.Add tgtWorksheet.Range("A1"),"http://www.vizubi.com/",,"NPrinting","NPrinting"

   wbTarget.Save

   xlApp.quit

  'clean up

  set wbTarget = nothing

  set tgtWorksheet = nothing

  set xlApp = nothing

  Set v1= Nothing

  Set v2= Nothing

  Msgbox ("Elaboration processed!")

end sub

Not applicable

Can you make the link active in embedded HTML email report in Nprinting.  I have a link field in QlikView that I want to use in HTML email message and allow the user to click on the link.  Is this possible.

Andrea_Ghirardello