Consultor Eletrônico



Kbase P149205: How to add a hyperlink to an OCX Microsoft Office Spreadsheet using 4GL?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   14/07/2009
Status: Unverified

GOAL:

How to add a hyperlink to an OCX Microsoft Office Spreadsheet using 4GL?

GOAL:

Add a hyperlink to an OCX Microsoft Office Spreadsheet pointing to a website

GOAL:

Add a hyperlink to an OCX Microsoft Office Spreadsheet pointing to a local file

FACT(s) (Environment):

Excel 2007
Excel 2003
Windows
OpenEdge 10.1B

FIX:

The following 4GL code demonstrates the syntax of how to add a hyperlink to an OCX Microsoft Office Spreadsheet cell:

DEFINE VARIABLE chSpreadSheet AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE chMyRange AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE Address AS CHARACTER NO-UNDO.
DEFINE VARIABLE TextToDisplay AS CHARACTER NO-UNDO.
chSpreadSheet = chCtrlFrame:MySpreadsheet("Sheet1").
chSpreadSheet:Cells:ClearContents.
/* Select cell to add link */

chMyRange=chSpreadSheet:Range("B4").

/* Define parameters for hyperlink */
Address = "http://www.google.com".
TextToDisplay = "GOOGLE".
/* Add formula in current cell*/
chMyRange:Formula='=HYPERLINK("' + Address + '","' + TextToDisplay + '")'.
RELEASE OBJECT chSpreadSheet.
RELEASE OBJECT chMyRange.