Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
In Microsoft Excel, you can add a library reference to the VBA project by clicking the Tools > References… manually.
The following sample code adds or registers two library references to the VBA project of the workbook using the VbaProjectReferenceCollection.addRegisteredReference(string, string) method.
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const outputPath = path.join(dataDir, "Output_out.xlsm");
const workbook = new AsposeCells.Workbook();
const vbaProj = workbook.getVbaProject();
vbaProj.getReferences().addRegisteredReference("stdole", "*\\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\\Windows\\system32\\stdole2.tlb#OLE Automation");
vbaProj.getReferences().addRegisteredReference("Office", "*\\G{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}#2.0#0#C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE14\\MSO.DLL#Microsoft Office 14.0 Object Library");
workbook.save(outputPath);
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.