Working with External Data Connection of type WebQuery with Node.js via C++

Working with External Data Connection of type WebQuery

The following code shows how to work with external data connection of type WebQuery. It uses the sample excel file which you can download from the provided link. You can also see the console output of this code further below.

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "WebQuerySample.xlsx");
// Loads the workbook which contains hidden external links
const workbook = new AsposeCells.Workbook(filePath);

const connections = workbook.getDataConnections();
if (connections.getCount() > 0) {
const connection = connections.get(0);

if (connection instanceof AsposeCells.WebQueryConnection) {
const webQuery = connection;
console.log("Web Query URL: " + webQuery.getUrl());
}
}

Console Output

Here is the console output of the above code with this sample excel file.

Web Query URL: https://docs.aspose.com/cells/nodejs-cpp/