Export VBA Certificate to File or Stream with Node.js via C++

Export VBA Certificate to File or Stream in Node.js

Please see the following sample code that saves the raw data of the VBA certificate into a file. You can download the sample Excel file used in this code from the provided link.

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

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");

// Load your source Excel file into a Workbook object
const workbook = new AsposeCells.Workbook(path.join(dataDir, "sampleVBAProjectSigned.xlsm"));

// Retrieve the byte data of the digital certificate of the VBA project
const certBytes = workbook.getVbaProject().getCertRawData();

// Save certificate data into a file stream
require("fs").writeFileSync(path.join(dataDir, "Cert_out_"), Uint8Array.from(certBytes));