Partager via


OLEDBConnection.SaveAsODC Method (Excel)

Saves the OLE DB connection as an Microsoft Office Data Connection file.

Version Information

Version Added: Excel 2007

Syntax

expression .SaveAsODC(ODCFileName, Description, Keywords)

expression A variable that represents an OLEDBConnection object.

Parameters

Name

Required/Optional

Data Type

Description

ODCFileName

Required

String

Location to save the file.

Description

Optional

Variant

Description that will be saved in the file.

Keywords

Optional

Variant

Space-separated keywords that can be used to search for this file.

Example

The following example saves the connection as an ODC file titled "ODCFile". This example assumes an OLE DB connection exists on the active worksheet.

Sub UseSaveAsODC() 
 
 Application.ActiveWorkbook.OLEDBConnection.SaveAsODC ("ODCFile") 
 
End Sub 

See Also

Concepts

OLEDBConnection Object Members

OLEDBConnection Object