Posts: 863
Threads: 197
Joined: Apr 2005
How can I set a hyperlink in a cell of excel?
Example:
Address="http://www.quickmacros.com"
TextToDisplay="Link1"
cell=B3
Posts: 863
Threads: 197
Joined: Apr 2005
function ~link ~text column row
;EXAMPLE
;ExcelSheet es.Init
;es.Hyperlink("http://www.google.es" "link" 5 3)
if(!ws) Init
Excel.Range r=ws.Cells.Item(row column)
r.Select
BSTR ad=link
VARIANT t=text
ws.Hyperlinks.Add(ws.Application.Selection ad @ @ t)
Posts: 863
Threads: 197
Joined: Apr 2005
How can I insert in a cell a hyperlink to a QM macro?
Posts: 12,141
Threads: 143
Joined: Dec 2002
When hyperlink is qm command line, it does not work?
Posts: 863
Threads: 197
Joined: Apr 2005
It can execute [qmcl.exe] but not [qmcl.exe M "Macro4"]
Posts: 12,141
Threads: 143
Joined: Dec 2002
Can use shortcut file.
But Excel shows 2 security warning msgboxes before running the file.
Posts: 863
Threads: 197
Joined: Apr 2005
Posts: 12,141
Threads: 143
Joined: Dec 2002
Can register custom URL protocol to run QM macros.
Macro
qm protocol register
;Registers custom URL protocol to run QM macros.
;Then you can run QM macros from:
;;;Windows 'Run' dialog and some programs: qm:macro name
;;;Hyperlinks: <a href="qm:macro name">link text</a>
if(!IsUserAdmin) mes- "QM must be running as administrator." "" "x"
rset "URL:QM Protocol" "" "qm" HKEY_CLASSES_ROOT
rset "" "URL Protocol" "qm" HKEY_CLASSES_ROOT
rset "qmcl.exe M ''qm_protocol_handler'' C %1" "" "qm\shell\open\command" HKEY_CLASSES_ROOT
Function
qm_protocol_handler
str s=_command+3
s.escape(8) ;;sometimes command is urlencoded, eg from firefox
;out s
mac s
err+
-----------
Shows only 1 warning in Excel.
In web browsers, shows warning only first time.