AppleScript,Microsoft Excel和超链接启用

有一个关于在Excel中创build活动超链接而不诉诸macros的问题 …但假设有人想要创build一个macros,或者更确切地说是AppleScript中的某些东西?

我开始掠夺Mac的AppleScript字典的Excel …到目前为止,我已经得到了这一点(假设列1包含一行一行的URI在每个单元格中,没有被激活):

tell application "Microsoft Excel" activate make new hyperlink of column 1 at active sheet with properties {address:column 1} end tell 

这几乎工作…除了每个单元格最终是一个超链接到http://www.microsoft.com/mac/相反! (很好,MSFT,嘿嘿)真的,我忍不住想我在这里很亲密,但我不知道我错过了什么。

为了比较,这里是一个工作的Excelmacros(使用select)。

 For Each xCell In Selection ActiveSheet.Hyperlinks.Add Anchor:=xCell, Address:=xCell.Formula Next xCell 

线索欢迎和赞赏!

我相信我有它! 假设单元格在第8列(不包括标题行)。 你可以做这样的事情。

 tell application "Microsoft Excel" tell (get used range of active sheet) repeat with i from 2 to count rows set v to value of column 8 of row i make new hyperlink at column 8 of row i with properties {address:v} end repeat end tell end tell 

NB:我不知道这是否是“正确”的AppleScript,但我认为这是一个开始。 随意提供改进,一切手段!