Application.FileSaveWorkspace Method (Project)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Saves a list of open files and the current settings in the Options dialog box.

expression .FileSaveWorkspace(Name)

expression A variable that represents an Application object.

Parameters

Name

Required/Optional

Data Type

Description

Name

Optional

String

The name of the file to create. If Name is omitted, Project prompts for the file name.

Return Value

Boolean

The following example saves the workspace based upon the name of the first project file.

Sub SaveWorkspaceByProjectName() 
 
    Dim WSName As String 
 
    If InStr(Projects(1).Name, ".") Then 
        WSName = Left$(Projects(1).Name, Len(Projects(1).Name) - 1) & "W" 
    Else 
        WSName = Projects(1).Name & ".MPW" 
    End If 
 
    FileSaveWorkspace WSName 
End Sub
Show: