HYPERLINK

HYPERLINK

Postby acwoo1 » Tue Jun 12, 2018 7:57 am

Hi

oSheet:Cells( 12,6 ):Value := '=HYPERLINK("c:\abc\TEST1.xlsx", "oExcel:Sheets(1):Select()" )'

How to hyperlink to sheet 1 of Test1


Thanks

Regards


ACWoo
Using bcc582 + FHW
acwoo1
 
Posts: 161
Joined: Tue Nov 10, 2009 10:56 am

Re: HYPERLINK

Postby AntoninoP » Tue Jun 12, 2018 9:06 am

AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: HYPERLINK

Postby anserkk » Tue Jun 12, 2018 9:57 am

acwoo1 wrote:Hi

oSheet:Cells( 12,6 ):Value := '=HYPERLINK("c:\abc\TEST1.xlsx", "oExcel:Sheets(1):Select()" )'

How to hyperlink to sheet 1 of Test1


Thanks

Regards


ACWoo
Using bcc582 + FHW


Did you try
Code: Select all  Expand view
=HYPERLINK("[C:\MyFolderName\MyExcelFile.xlsx]Sheet1!C5","CLICK HERE")


This will navigate to

Workbook - C:\MyFolderName\MyExcelFile.xlsx
Sheet - Sheet1
Cell - C5
User avatar
anserkk
 
Posts: 1331
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: HYPERLINK

Postby acwoo1 » Wed Jun 13, 2018 2:50 am

Thanks

It works.

Regards

ACWoo
acwoo1
 
Posts: 161
Joined: Tue Nov 10, 2009 10:56 am

Re: HYPERLINK

Postby acwoo1 » Sun Jun 17, 2018 2:04 am

Hi

=HYPERLINK("[C:\MyFolderName\MyExcelFile.xlsx]Sheet1-A!C5","CLICK HERE")

If the page (Sheet1-A) has a hyphen, the link is not valid. How to overcome this.

Thanks

Regards

ACWoo
Using bcc582
FWH
acwoo1
 
Posts: 161
Joined: Tue Nov 10, 2009 10:56 am

Re: HYPERLINK

Postby anserkk » Sun Jun 17, 2018 2:16 pm

acwoo1 wrote:Hi

=HYPERLINK("[C:\MyFolderName\MyExcelFile.xlsx]Sheet1-A!C5","CLICK HERE")

If the page (Sheet1-A) has a hyphen, the link is not valid. How to overcome this.

Please try replacing the sheet name within single quotes ' '. For eg

Code: Select all  Expand view
=HYPERLINK("[C:\MyFolderName\MyExcelFile.xlsx]'Sheet1-A'!C5","CLICK HERE")


'Sheet1-A'!C5
User avatar
anserkk
 
Posts: 1331
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: HYPERLINK

Postby acwoo1 » Sun Jun 17, 2018 10:24 pm

Hi

Thanks

I get :

Syntax error at 'SHEET1'

Regards

ACWoo
Bcc582
FWH
acwoo1
 
Posts: 161
Joined: Tue Nov 10, 2009 10:56 am

Re: HYPERLINK

Postby anserkk » Mon Jun 18, 2018 4:41 am

Code: Select all  Expand view
cText := ""
TEXT INTO cText
=HYPERLINK("[D:\\MyExcelFile.xlsx]'Sheet1 A'!C5","CLICK HERE")
ENDTEXT


Now use the cText on the cell
User avatar
anserkk
 
Posts: 1331
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: HYPERLINK

Postby bpd2000 » Mon Jun 18, 2018 9:41 am

Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   local oExcel := CreateObject( "excel.application" )
   local oBook  := oExcel:Workbooks:Add()
   local oSheet := oBook:Worksheets( 1 )

   oSheet:Range( "A1" ):Value = "Last Name"
   oSheet:Range( "B1" ):Value = "First Name"
   oSheet:Range( "A1:B1" ):Font:Bold = .T.
   
   oSheet:Range( "A2" ):Value = "Doe"
   oSheet:Range( "B2" ):Value = "John"
   
   oSheet:Range( "D4" ):Value:='=HYPERLINK("#Sheet1!A12","Test1")'
   // insert correct full path for hyperlinked file
   oSheet:Range( "A10" ):Value := '=HYPERLINK("[c:\Myfolder\Bookx.xls]Sheet1!C5","CLICK HERE")'
   oSheet:Range( "A12" ):Value:='=HYPERLINK("#Sheet1!D4","Test2")'
   oSheet:Range( "A13" ):Value:='=HYPERLINK("#Sheet2!E18","Test3")'
   oBook:WorkSheets("Sheet2"):Range( "E18"):Value:='=HYPERLINK("#Sheet1!A13","Test4")'

//   oBook:SaveAs( CurDrive() + ":\" + CurDir() + "\Book1x.xls" )
   oExcel:Visible = .T.

   // oExcel:Quit()

   MsgInfo( "Demo Excel File Created" )

return nil
   
   
Regards, Greetings

Try FWH. You will enjoy it's simplicity and power.!
User avatar
bpd2000
 
Posts: 153
Joined: Tue Aug 05, 2014 9:48 am
Location: India

Re: HYPERLINK

Postby acwoo1 » Tue Jun 19, 2018 5:15 am

Thanks

It works.

Regards.

ACWoo
acwoo1
 
Posts: 161
Joined: Tue Nov 10, 2009 10:56 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 34 guests