Connections.AddFromFile method (Excel)

Adds a connection from the specified file.

Syntax

expression.AddFromFile (FileName, CreateModelConnection, ImportRelationships)

expression A variable that represents a Connections object.

Parameters

Name Required/Optional Data type Description
FileName Required String Name of the file.
CreateModelConnection Optional Boolean Specifies whether to create the connection to the model.
ImportRelationships Optional Boolean Specifies whether to import the connection relationship.

Return value

WorkbookConnection

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.