EXCEL CREATE HYPERLINK

Post Reply
User avatar
MarcoBoschi
Posts: 1070
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

EXCEL CREATE HYPERLINK

Post 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

#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
 
Marco Boschi
info@marcoboschi.it
User avatar
MarcoBoschi
Posts: 1070
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: EXCEL CREATE HYPERLINK solved

Post by MarcoBoschi »

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

:idea:
Marco Boschi
info@marcoboschi.it
User avatar
Euclides
Posts: 156
Joined: Wed Mar 28, 2007 1:19 pm

Re: EXCEL CREATE HYPERLINK

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

Re: EXCEL CREATE HYPERLINK

Post 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
Marco Boschi
info@marcoboschi.it
Post Reply