Class DataFeedConnection (Excel VBA)

Contains the data and functionality needed to connect to data feeds. The same object is used for all Data Feed types.

Class WorkbookConnection gives access to class DataFeedConnection.

To use a DataFeedConnection class variable it first needs to be instantiated, for example

Dim dfc as DataFeedConnection
Set dfc = ActiveWorkbook.Connections(1).DataFeedConnection

DataFeedConnection class variables can be set using the WorkbookConnection.DataFeedConnection procedure.


CancelRefresh - Cancels a refresh operation on a data feed connection.

Refresh - Refreshes the data feed connection.

SaveAsODC - Saves the data feed connection as a Microsoft Office Data Connection file.


AlwaysUseConnectionFile true if the connection file is always used to establish a connection to the data source.

CommandText returns or sets the command string for the specified data source. Read/write Variant.

CommandType returns or sets the command string for the specified data source.

Connection returns or sets a string that contains Service Contract settings that enable Microsoft Excel to connect to a Data Feed data source.

EnableRefresh true if the connection can be refreshed by the user. The default value is True.

RefreshDate returns the date on which the OLE DB connection was last refreshed.

Refreshing true if an OLE DB query is in progress for the specified data source connection.

RefreshOnFileOpen true if the connection is automatically updated each time the workbook is opened. The default value is False.

RefreshPeriod returns or sets the number of minutes between refreshes.

SavePassword true if password information in a data feed connection string is saved in the connection string. False if the password is removed.

ServerCredentialsMethod returns or sets the type of credentials that should be used for server authentication.

SourceConnectionFile returns or sets a String indicating the Microsoft Office Data Connection file or similar file that was used to create the connection.

SourceDataFile a path to the original file used to create the connection. In the case of an OData connection, this is the location of the *.atom or *.atomsvc file used to create the connection.