Page 1 of 1

EXCEL CREATE HYPERLINK

PostPosted: Thu Mar 28, 2024 11:45 am
by MarcoBoschi
Hi,
I have to create an hyperlink from cell A1 of sheet2 to cell A1 of sheet1
If I click on the cell "MARCO" I want to go to the cell "BOSCHI"
When I click on it I have this alert (italy)

"Indirizzo del sito non valido. Controllare l'indirizzo e riprovare"
What I'm doing wrong?
bye

Code: Select all  Expand view
#include "fivewin.ch"
FUNCTION MAIN()
LOCAL oExcel
LOCAL oAs1, oAs2


oExcel := CREATEOBJECT( "Excel.Application" )
oExcel:Workbooks:Add()

iConta := oExcel:WorkSheets:count
oExcel:WorkSheets:Add( oExcel:WorkSheets( iConta ) )
oAs1       := oExcel:ActiveSheet()

oAs1 := oExcel:Activesheet()
oAs1:name := "UNO"


iConta := oExcel:WorkSheets:count
oExcel:WorkSheets:Add( oExcel:WorkSheets( iConta ) )
oAs2       := oExcel:ActiveSheet()

oAs2 := oExcel:Activesheet()
oAs2:name := "DUE"

oExcel:Worksheets( "Foglio1" ):Delete()
oExcel:Worksheets( "Foglio2" ):Delete()
oExcel:Worksheets( "Foglio3" ):Delete()


oExcel:Visible := .T.

oAs2:Range( "A1" ):Value := "MARCO"
oAs1:Range( "A1" ):Value := "BOSCHI"

// oAs1:Hyperlinks:Add( oAs2:Range( "A1" ), oAs1:Range( "A1" )   )

oAs1:Hyperlinks:Add( oAs2:Range( "A1" ), oAs1:Range( "A1" )   )


RETURN NIL
 

Re: EXCEL CREATE HYPERLINK solved

PostPosted: Thu Mar 28, 2024 1:18 pm
by MarcoBoschi
In this way
oAs2:Range("A1"):value := [=COLLEG.IPERTESTUALE("#UNO!A1";"MARCO")]

:idea:

Re: EXCEL CREATE HYPERLINK

PostPosted: Fri Mar 29, 2024 8:32 pm
by Euclides
Thanks Marco!
Here is: oAs2:Range("A1"):value := [=COLLEG.IPERTESTUALE("#UNO!A1";"MARCO")]

Note: Some sites: (https://pt.excelfunctions.eu/) translate COLLEG.IPERTESTUALE (HYPERLINK) to HIPERLIGAÇÃO that gives ERROR.
The correct is (here in Brazil): oAs2:Range("A1"):value := [=HIPERLINK("#UNO!A1";"MARCO")]
Regards, Euclides

Re: EXCEL CREATE HYPERLINK

PostPosted: Tue Apr 02, 2024 9:40 am
by MarcoBoschi
When I click on cell from the worksheet named "MASTER" that has a hyperlink to another cell in "DETAILS" worksheet I found the cell in the bottom of the video. This almost always happens.

Is it possible to scroll the worksheet so that when I go into a cell that it is positioned in the upper left corner of my window so I can see other rows.
To understand it is a master detail relationship between header and rows of bills.

Many thanks
Marco