简体   繁体   English

excel 宏的完整文件路径

[英]Full file path of an excel macro

I am trying to reference an excel macro using my python code, and I want to know the full filepath of the macro itself.我正在尝试使用我的 python 代码引用 excel 宏,并且我想知道宏本身的完整文件路径。 The macro is called 'Highlight' and is stored in the personal workbook I have tried this so far:该宏称为“突出显示”并存储在我迄今为止尝试过的个人工作簿中:

C:\\Users\\Jack1\\AppData\\Roaming\\Microsoft\\Excel\\XLSTART\\PERSONAL.XLSB!Module2.Highlight

Thank you for your help!谢谢您的帮助!

I want to know the full filepath of the macro itself我想知道宏本身的完整文件路径

According to sources like https://bettersolutions.com/excel/macros/personal-xlsb.htm or https://www.excelforum.com/excel-programming-vba-macros/679412-where-are-macros-saved.html the location of the Macro should be:根据https://bettersolutions.com/excel/macros/personal-xlsb.htmhttps://www.excelforum.com/excel-programming-vba-macros/679412-where-are-macros-等来源html宏的位置应该是:

C:\Users\your_user_id\AppData\Roaming\Microsoft\Excel\XLSTART

In this directory the following syntax can be looked after:在此目录中,可以查看以下语法

excelsheet_name.xlsm!modulename.macroname

Therefore the full path to your macro would be:因此,您的宏的完整路径将是:

C:\Users\your_user_id\AppData\Roaming\Microsoft\Excel\XLSTART\excelsheet_name.xlsm!modulename.macroname

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM