vba 您的个人宏工作簿位于何处?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44183185/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 10:50:56  来源:igfitidea点击:

Where is your personal macro workbook located?

excelexcel-vbavba

提问by swridings

I'm looking for the Excel file where my personal macro workbook is stored. Does anyone know where that file might be on a Windows 7 computer?

我正在寻找存储我的个人宏工作簿的 Excel 文件。有谁知道该文件在 Windows 7 计算机上的位置?

回答by swridings

Actually, I found the answer. You can find the file PERSONAL.XLSB by using the code below.

其实我找到了答案。您可以使用以下代码找到文件 PERSONAL.XLSB。

Sub Find_Personal_Macro_Workbook()

    Dim path As String

    path = Application.StartupPath

    MsgBox path

End Sub

Hidden items will need to be selected in your file explorer to see where this is.

需要在文件资源管理器中选择隐藏的项目才能看到它的位置。

Hope this helps anyone who needs to find this file.

希望这可以帮助任何需要找到此文件的人。

回答by Aisah

In this folder: C:\Users\YourUser\AppData\Roaming\Microsoft\Excel\XLSTART

在此文件夹中:C:\Users\YourUser\AppData\Roaming\Microsoft\Excel\XLSTART

(Hidden Items needs to be selected in your files explorer)

(需要在文件资源管理器中选择隐藏项目)

If you don't have a Roaming folder use the Local folder. Rest of the path should be the same.

如果您没有漫游文件夹,请使用本地文件夹。其余路径应该相同。

回答by Bhanu Sinha

Follow the following steps: 1. Open Excel 2. Unhide Personal Workbook from View->Unhide 3. Press F12 to locate the path of the workbook.

请按照以下步骤操作: 1. 打开 Excel 2. 从“视图”->“取消隐藏”中取消隐藏个人工作簿 3. 按 F12 找到工作簿的路径。

回答by dzozo

Just to build on swridings answer and have it paste that path to a cell so you can copy and paste it into the explorer, see below:

只是为了建立在 swridings 答案并将其粘贴到单元格的路径,以便您可以将其复制并粘贴到资源管理器中,请参见下文:

Sub Find_Personal_Macro_Workbook()

    Dim path As String

    path = Application.StartupPath

    Sheets.Add After:=ActiveSheet
    ActiveSheet.Range("$A").Value = path

End Sub

回答by onec0de

the personal macros are stored in a .xlsb file, usually PERSONAL.XLSB just use the Search function on your os drive (ie C:) and you will find it!

个人宏存储在 .xlsb 文件中,通常是 PERSONAL.XLSB 只需使用操作系统驱动器(即 C:) 上的搜索功能,您就会找到它!