SaveAs method (VBA Add-In Object Model)

Saves a project to a given location by using a new filename.

Syntax

object.SaveAs (newfilename) As String

The SaveAs method syntax has these parts.

Part Description
object An object expression that evaluates to an object in the Applies To list.
newfilename Required. A string expression specifying the new filename for the component to be saved.

Remarks

If a new path name is given, it is used. Otherwise, the old path name is used. If the new filename is invalid or refers to a read-only file, an error occurs.

The SaveAs method can only be used on standalone projects. It generates a run-time error if you use it with a host project.

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.