English 中文(简体)
优的相对路径链接
原标题:Relative paths links in excel

我有一个有电子邮件链接的绝佳文件。 我想有一个可点击的链接下载这些文件 。

在同一文件夹中有两个文件( 优异和电子邮件), 链接文件 ::// test. eml 或仅测试 。 eml 不打开它, 我需要使用绝对路径 。 有办法做到这一点吗?

谢谢 谢谢

<强 > EDIT

绝对路径是一个已知值, 但无论如何, 文件没有打开 。

=HYPERLINK("C:Userslanca.hernandezDesktop2012-05-24T09-41-11-0.00007.eml", "email")

这很有趣,因为 类似的东西

档案: C: Userslanca.hernandez Desktop2012-05-24T09-41-11-00007.eml

给我一个 kickabe 链接可以打开文件, 但是如果我想对其它目录做同样的事情, as

档案: C: epositorive projectorsarchive20125241121012-05-24T09-41-11-0.007.eml

无法打开它。 这样做有什么原因吗?

最佳回答

您可以使用 Hyperlink (LinkLocation, FriendName") 函数与 Cell ("filename") 函数结合使用 Hyperlink (LinkLionLocation,FriendName") (与 Cell ("filename"))

Cell("filename") returns the full file name of the file that contains the reference as
C:FullPath[FileName.xlsm]SheetName
To get just the path use
LEFT(CELL("filename"),FIND("*", SUBSTITUTE(CELL("filename"), "", "*", LEN(CELL("filename")) - LEN(SUBSTITUTE(CELL("filename"),"","")))))

Hyperlink( 链接、 友好Name) 创建超链接


要链接到文件 test.eml , 完整的公式是

=HYPERLINK(LEFT(CELL("filename"),FIND("*",SUBSTITUTE(CELL("filename"),"","*",LEN(CELL("filename"))-LEN(SUBSTITUTE(CELL("filename"),"","")))))&"test.eml","Link to File")
问题回答
    MyPath = ActiveWorkbook.Path

它将为你们提供一种通向工作簿的道路,





相关问题
import of excel in SQL imports NULL lines

I have a stored procedure that imports differently formatted workbooks into a database table, does work on them then drops the table. Here is the populating query. SELECT IDENTITY(INT,1,1) AS ID ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

Excel date to Unix timestamp

Does anyone know how to convert an Excel date to a correct Unix timestamp?

C# GemBox Excel Import Error

I am trying to import an excel file into a data table using GemBox and I keep getting this error: Invalid data value when extracting to DataTable at SourceRowIndex: 1, and SourceColumnIndex: 1. As ...

Importing from excel "applications" using SSIS

I am looking for any tips or resources on importing from excel into a SQL database, but specifically when the information is NOT in column and row format. I am currently doing some pre-development ...