MS Excel 具有动态 link_location 的 HYPERLINK() 函数不起作用 - 为什么?
MS Excel HYPERLINK() function with dynamic link_location does not work - why?
我试图将电子表格自己的文件名包含在使用以下公式动态创建的电子邮件正文中,包括 VBA 模块 (?) 函数:
=HYPERLINK("mailto:"&"address"&"?subject="&B7&"&body="&B7&FullName(); "E-Mail")
函数是
Function FullName() As String
FullName = ThisWorkbook.FullName()
End Function
在文档的 "module" 中(我不知道 VBA:ALT+F11,插入模块。显然这也称为用户定义函数(UDF)).
该函数在一个单元格中独立运行,HYPERLINK 公式在不添加到其 link_location 函数的情况下运行,但一起(如上所述),它的计算结果为
#NAME?
链接:
- Office 文档:HYPERLINK function
- 可能相关,但有些相反的问题:VBA to open Excel hyperlink does not work when hyperlink generated with a formula
- Hyperlink custom link_location formula 不是动态的
- 非常相似的问题:Creating a custom hyperlink function in excel
按照问题中后者 link 的 this answer (不要使用 HYPERLINK 公式,而是一个函数更改单元格中手动创建的 link)。
我试图将电子表格自己的文件名包含在使用以下公式动态创建的电子邮件正文中,包括 VBA 模块 (?) 函数:
=HYPERLINK("mailto:"&"address"&"?subject="&B7&"&body="&B7&FullName(); "E-Mail")
函数是
Function FullName() As String
FullName = ThisWorkbook.FullName()
End Function
在文档的 "module" 中(我不知道 VBA:ALT+F11,插入模块。显然这也称为用户定义函数(UDF)).
该函数在一个单元格中独立运行,HYPERLINK 公式在不添加到其 link_location 函数的情况下运行,但一起(如上所述),它的计算结果为
#NAME?
链接:
- Office 文档:HYPERLINK function
- 可能相关,但有些相反的问题:VBA to open Excel hyperlink does not work when hyperlink generated with a formula
- Hyperlink custom link_location formula 不是动态的
- 非常相似的问题:Creating a custom hyperlink function in excel
按照问题中后者 link 的 this answer (不要使用 HYPERLINK 公式,而是一个函数更改单元格中手动创建的 link)。