Excel Hyperlinks Progress Syntax

robpro64

New Member
Has anyone out there who is accustomed to programmatically exporting data from a Progress program to Excel had to create a cell value which is actually a hyperlink. For example, VB shows this syntax:

Range("A1").Select
ActiveCell.FormulaR1C1 = "TS1"
Range("A1").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"www.google.com", _
TextToDisplay:="GOOGLE"
End Sub

Progress just shows a very criptic syntax of:

[ Com-Handle-Var = ] <com-handle>: Add (
Com-Handle-Anchor,
Character-Address,
<anytype>-SubAddress,
<anytype>-ScreenTip,
<anytype>-TextToDisplay ).

Can anyone send me a real world Progress sample of this. Thanks.
 
robpro64 said:
Has anyone out there who is accustomed to programmatically exporting data from a Progress program to Excel had to create a cell value which is actually a hyperlink. For example, VB shows this syntax:

Range("A1").Select
ActiveCell.FormulaR1C1 = "TS1"
Range("A1").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"www.google.com", _
TextToDisplay:="GOOGLE"
End Sub

Progress just shows a very criptic syntax of:

[ Com-Handle-Var = ] <com-handle>: Add (
Com-Handle-Anchor,
Character-Address,
<anytype>-SubAddress,
<anytype>-ScreenTip,
<anytype>-TextToDisplay ).

Can anyone send me a real world Progress sample of this. Thanks.

Hi,

I have made a small sample you could try. It has been tested with office XP, but it should work with office versions 97 and higher.

[<code>]

define variable hExcelApplication as com-handle no-undo.
define variable hWorkbook as com-handle no-undo.
define variable hWorksheet as com-handle no-undo.
define variable hActiveCell as com-handle no-undo.
define variable hHyperLink as com-handle no-undo.

create "excel.application" hExcelApplication.
hExcelApplication:visible = true.

hWorkbook = hExcelApplication:workbooks:add().

hWorksheet = hExcelApplication:sheets:item(1).
hWorksheet:range("A1"):select().
hActiveCell = hExcelApplication:activecell.
hHyperlink = hWorkSheet:Hyperlinks:add(hActiveCell,"http://www.google.com","","","GOOGLE").

/* Important, always release com-handle objects to avoid memory leaks */

release object hHyperlink.
release object hActiveCell.
release object hWorksheet.
release object hWorkbook.
release object hExcelApplication.

[</code>]

I hope this will get you on your way.
Ruud
 
Back
Top