RecentFile and RecentFiles Members

Use the RecentFiles collection to get the list of recently opened files from the Excel File menu. Use the Application object’s RecentFiles method to get a reference to this collection. Use the RecentFile object to open or remove files from this list. The RecentFiles collection and RececentFile object have the following members. Key members (shown in bold) are covered in the following reference section:

1 Collection only

2 Object and collection

Add 2

Application 2

Count 1

Creator 2

Delete

Index

Item 1

Maximum 1

Name

Open

Parent 2

Path

By default, Excel doesn’t add files opened programmatically to the recent file list. To add those files, use the Open method with the AddToMRU argument set to True or use the RecentFiles collection’s Add method.

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.