Exportera VBA certifikat till fil eller ström med Node.js via C++
Contents
[
Hide
]
Aspose.Cells låter dig exportera VBA Digital Certificate till ström som fil eller minnesström. Du kan komma åt rådata för det VBA digitala certifikatet med hjälp av VbaProject.getCertRawData() egenskapen.
Exportera VBA-certifikat till fil eller ström i Node.js
Vänligen se följande exempelkod som sparar rådata för VBA-certifikatet i en fil. Du kan ladda ned provexelfilen som används i denna kod från den angivna länken.
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 workbook object
const workbook = new AsposeCells.Workbook(path.join(dataDir, "sampleVBAProjectSigned.xlsm"));
// Retrieve bytes data of Digital Certificate of VBA Project
const certBytes = workbook.getVbaProject().getCertRawData();
// Save Certificate Data into FileStream
require("fs").writeFileSync(path.join(dataDir, "Cert_out_"), Uint8Array.from(certBytes));