Microsoft Office Tutorials and References
In Depth Information
16.1.6.7 RecentFiles property (Read-Only)
16.1.6.7 RecentFiles property (Read-Only)
This property returns a RecentFiles collection that represents the list of recently used files. There
are two interesting aspects to the RecentFiles collection. First, it has a Maximum property that
returns or can be set to the maximum number of files allowed in the recently used files list that
appears on Excel's File menu. This number must be an integer between 0 and 9, inclusive. Thus,
the code:
MsgBox Application.RecentFiles.Maximum
displays the current value.
Second, we can print a list of the filenames of the most recently used files as follows (of course,
you may want to do more than print this list):
Dim rf As RecentFile
For Each rf In Application.RecentFiles
Debug.Print rf.Name
Next
Note that the RecentFiles collection contains RecentFile objects, and not simply the names of the
recently used files, as one might expect.
16.1.6.8 SaveWorkspace method
This method saves the current workspace. Its syntax is:
Application.SaveWorkspace( Filename )
where Filename is an optional filename for the xlw file.
16.1.7 Members that Affect the Current State of Excel
The following members have an effect on the current settings of Excel:
CopyObjectsWithCells property (R/W Boolean)
When this property is True , objects (such as embedded controls or shapes) are cut,
copied, extracted, and sorted along with cells.
Cursor property (R/W Long)
This property returns or sets the appearance of the mouse pointer. It can be one of the
following XlMousePointer constants:
Enum XlMousePointer
xlDefault = -4143
xlNorthwestArrow = 1
xlWait = 2
xlIBeam = 3
End Enum
It is considered good programming practice to set the mouse pointer to xlWait if your
code will take more than a second or so to complete. Of course, you will need to return
the mouse pointer to its previous state when the procedure terminates. The proper way to
Search JabSto ::




Custom Search