1

我开发了一个 perl 脚本来从文本文件中查找匹配的字符串并将其复制到电子表格中,我还将文本文件名包含在电子表格中以获取相应的匹配字符串。现在我想通过单击每个单元格中的文件名来打开文件的超链接。

任何帮助将非常感激!我不是一个程序员...谢谢!

4

1 回答 1

3

以下是使用 Spreadsheet::WriteExcel 的一些示例

# External link to a local file
$worksheet->write('B2', 'external:Italy.xls');

# External link to a local file with worksheet
$worksheet->write('B3', 'external:Italy.xls#Sales!B3');

# External link to a local file with worksheet and alternative string
$worksheet->write('B4', 'external:Italy.xls#Sales!B4', 'Link');

# External link to a local file with worksheet and format
$worksheet->write('B5', 'external:Italy.xls#Sales!B5', $format);

# External link to a remote file, absolute path
$worksheet->write('B6', 'external:c:/Temp/Asia/China.xls');

# External link to a remote file, relative path
$worksheet->write('B7', 'external:../Asia/China.xls');

# External link to a remote file with worksheet
$worksheet->write('B8', 'external:c:/Temp/Asia/China.xls#Sales!B8');

# External link to a remote file with worksheet (with spaces in the name)
$worksheet->write('B9', q{external:c:/Temp/Asia/China.xls#'Product Data'!B9});

您可以查看write API以获取更多信息。

于 2013-01-29T08:28:50.527 回答