Article ID: 272717 - Last Review: July 4, 2007 - Revision: 4.3 XL2000: How To Add the Workbook Path to the Title BarThis article was previously published under Q272717 On This PageSUMMARY
This article provides a sample Microsoft Visual Basic for Applications
macro that adds the workbook path and file name to the title bar of a
workbook when opening or saving a file.
MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. Sample CodeTo add the saved document file name and path to the title bar of the active document, follow these steps:
Using the Macro to Open a FileTo open an existing file, follow these steps:
Using the Macro to Save a FileTo save a new file, follow these steps:
Running the Macro Automatically When You Start ExcelTo run the macro automatically when you start Excel, save the workbook with the new code in the Xlstart folder.Assigning the Macros to Toolbar ButtonsTo customize Excel and assign the macros to the built-in toolbar buttons, follow these steps:
Assigning the Macros to Built-in MenusTo assign these macros to the built-in commands on the File menu, follow these steps:
Having the Macros Available the Next Time You Start ExcelTo have the macros available when you start Excel, hide the workbook. To do this, click Hide on the Windows menu. When you click Exit on the File menu, click Yes if you are prompted to save changes to the hidden workbook.REFERENCESFor additional information about getting help with Visual Basic for Applications, click the article number below
to view the article in the Microsoft Knowledge Base:
163435
(http://support.microsoft.com/kb/163435/EN-US/
)
Programming Resources for Visual Basic for Applications
For more information about how to use the sample code in this article, click
the article number below to view the article in the Microsoft Knowledge
Base:
212536
(http://support.microsoft.com/kb/212536/EN-US/
)
OFF2000: How to Run Sample Code from Knowledge Base Articles
| Article Translations
|
Back to the top
