Excelfunction区文件重命名后不起作用

Heyy我一直在创buildmacros,然后将它们添加到Excel(2010)上的自定义function区。 我有的问题是,每次我重命名原始文件(另存为),我创build了macros和function区,然后单击function区/macros,它会自动打开原始文件,为它作为新的文件保存为文件。 如果我从原始path中删除文件,然后再次打开重命名的文件,并使用function区运行macros它不运行它给我找不到错误文件。

我已经导出自定义function区用户界面,当我打开它使用记事本+ +我可以看到原始文件的硬编码path有无论如何解决这个?? 重新命名这些丝带每次我用不同的名称或不同的path保存文件….

从这里使用自定义UI编辑器: http : //openxmldeveloper.org/blog/b/openxmldeveloper/archive/2010/08/10/23248.aspx

这里有一个微软指南: http : //msdn.microsoft.com/en-us/library/ee691832(v=office.14).aspx

当实际编码macros和色带时,避免对名称进行硬编码,并且完美地工作。 下面是我在其中一个macros文件中使用的代码:

<?xml version="1.0" encoding="utf-8"?> <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"> <ribbon> <tabs> <tab id="refunds" label="Refunds/Returns" > <group id="financeRefund" label="Refunds &amp; Returns" > <button id="refresh" visible="true" size="large" label="Refresh Front Page" keytip="R" screentip="Refresh the frontpage without clearing the data in the data sheet." onAction="refreshfp" imageMso="RecurrenceEdit" /> <button id="new" visible="true" size="large" label="Update Data" keytip="S" screentip="Pulls in new data from the live sheet, clearing any changes made to the current data sheet." onAction="updateData" imageMso="ExportSharePointList" /> </group> </tab> </tabs> </ribbon> </customUI> 

希望这可以帮助