public static void Run()
{
// ExStart:FindQueryTablesAndListObjectsOfExternalDataConnections
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Load workbook object
Workbook workbook = new Workbook(dataDir + "sample.xlsm");
// Check all the connections inside the workbook
for (int i = 0; i < workbook.DataConnections.Count; i++)
{
Aspose.Cells.ExternalConnections.ExternalConnection externalConnection = workbook.DataConnections[i];
Console.WriteLine("connection: " + externalConnection.Name);
PrintTables(workbook, externalConnection);
Console.WriteLine();
}
Console.WriteLine("Press any key to continue...");
Console.ReadKey();
// ExEnd:FindQueryTablesAndListObjectsOfExternalDataConnections
}
// ExStart:PrintTables