Aspose.Cells.Examples.CSharp.Articles.FindQueryTablesAndListObjectsOfExternalDataConnections.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        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
FindQueryTablesAndListObjectsOfExternalDataConnections