Class RecentFile (Excel VBA)
The class RecentFile represents a file in the list of recently used files.
To use a RecentFile class variable it first needs to be instantiated, for example
Dim strName As String: strName = Dim rcnfl As RecentFile Set rcnfl = Application.RecentFiles.Add(Name:=strName)
Here is an example of processing the RecentFile items in a collection.
Dim rcnflRecentFile As RecentFile For Each rcnflRecentFile In Application.RecentFiles Next rcnflRecentFile
The following procedures in this class have been grouped together and are described on a separate theme page
These are the main methods of the RecentFile class
Delete - Deletes the object.
Index returns a Long value that represents the index number of the object within the collection of similar objects.
Name returns a String value that represents the name of the object.
Parent returns the parent object for the specified object. Read-only.
Path returns a String value that represents the complete path to the workbook or file that this RecentFile object represents.
RecentFiles.Count returns a Long value that represents the number of objects in the collection.
RecentFiles.Item returns a single object from a collection.
RecentFiles.Maximum returns or sets the maximum number of files in the list of recently used files. Can be a value from 0 (zero) through 50.
Application.RecentFiles.Maximum = 6
RecentFiles.Parent returns the parent object for the specified object. Read-only.