Hyperlinks to local paths do not work.

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
d3nton
Posts: 137
Joined: Thu Oct 25, 2012 9:48 am

Hyperlinks to local paths do not work.

Post by d3nton »

Hi!

I tried to create hyperlinks with the following code using XLS ReadWrite 5.10.07:
var
ExcelFile5 : TXLSReadWriteII5;

begin
ExcelFile5 := TXLSReadWriteII5.Create(nil);
ExcelFile5.Filename := 'D:\output.xlsx';

ExcelFile5.Sheets[0].MakeHyperlink(0,0,'C:\Windows', 'C:\Windows' );
ExcelFile5.Write;
end.

It seems that XLSReadWrite converts the address C:\Windows to ..\Windows (unit xlshyperlinks5; function setAddress).
If I open the excel file afterwards and try to click on the hyperlink, the path cannot be found.

If I try to add hyperlinks to an xls (Excel97) file, the hyperlink address is empty.
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Hyperlinks to local paths do not work.

Post by larsa »

Hello

The problem is fixed in update 5.10.08.

In order to make sure that a file is detected correct, write files as 'file///c:\MyFile.txt'
Lars Arvidsson, Axolot Data
d3nton
Posts: 137
Joined: Thu Oct 25, 2012 9:48 am

Re: Hyperlinks to local paths do not work.

Post by d3nton »

Thank you.

Works for XLSX files.
Unforatunately the hyperllinks in xls files are still broken (no address is set):

var
ExcelFile5 : TXLSReadWriteII5;

begin
ExcelFile5 := TXLSReadWriteII5.Create(nil);
ExcelFile5.Version := xvExcel97;
ExcelFile5.Filename := 'D:\output.xls';

ExcelFile5.Sheets[0].MakeHyperlink(0,0,'file:///C:\Windows', 'C:\Windows' );
ExcelFile5.Write;
end.
Post Reply