EXCEL CREATE HYPERLINK

EXCEL CREATE HYPERLINK

Postby MarcoBoschi » Thu Mar 28, 2024 11:45 am

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
 
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: EXCEL CREATE HYPERLINK solved

Postby MarcoBoschi » Thu Mar 28, 2024 1:18 pm

In this way
oAs2:Range("A1"):value := [=COLLEG.IPERTESTUALE("#UNO!A1";"MARCO")]

:idea:
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: EXCEL CREATE HYPERLINK

Postby Euclides » Fri Mar 29, 2024 8:32 pm

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
User avatar
Euclides
 
Posts: 156
Joined: Wed Mar 28, 2007 1:19 pm

Re: EXCEL CREATE HYPERLINK

Postby MarcoBoschi » Tue Apr 02, 2024 9:40 am

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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 78 guests