0

I am having a base template which is in the .xslm format and I want to read this file and preserve all those VBA and macros in it

I tried using npm's xslx package it preserves the VBA and macros but I am loosing all data validations and styles.I want a package that support writing .xlsm format without losing the VBA and macros.

Any other packages will do this job?

Community
  • 1
  • 1
Jaspher J
  • 29
  • 9
  • People who are down voting it , realize it there is no npm package that supports this functionality. If you have any answer ,let me know – Jaspher J Dec 05 '17 at 22:00

1 Answers1

0

You could try this library. Here's an example, from their npm page:

var parseXlsx = require('excel');

parseXlsx('Spreadsheet.xlsx', function(err, data) {
  if(err) throw err;
    // data is an array of arrays
});

Source.

There's also this library. Which supports more formats.

The GitHub page for the project seems to be gone, however.

As well as this library. Example:

var excelParser = require('excel-parser');
excelParser.worksheets({
  inFile: 'my_file.in'
}, function(err, worksheets){
  if(err) console.error(err);
  console.log(worksheets);
});

Source.

Eli Richardson
  • 934
  • 7
  • 25
  • The problem with these packages is they don't support writing .xslm excel files. They might read but they can't support write. I need to do some data manipulation and write the file in .xlsm format without losing any of the VBA and macro. – Jaspher J Dec 05 '17 at 21:35
  • @JaspherJ https://www.npmjs.com/package/ssm-xlsx claims to support that format I believe. – Eli Richardson Dec 05 '17 at 21:37
  • Thanks for your reply but they don't support writing .xlsm file format. – Jaspher J Dec 05 '17 at 21:40
  • Ah, I see. Sorry about that. You should probably update your question to include reading and writing to the file. As for the question, I think you'll have to end up making your own writer. I can't find any online that support it. – Eli Richardson Dec 05 '17 at 21:41
  • I guess so. That's why I planned to shift the platform to C# Net. – Jaspher J Dec 05 '17 at 21:46