1

Im using Javascript and ActiveXObject’s, look at this link here. I’m using ActiveXObject's to open an Excel file do some logic and save the file. What I need to accomplish is to open an Excel workbook that has multiple sheets, and save one of the sheets as a new Excel workbook(newfile.xlsx). This code below does exactly what I need it too except it saves as a CSV instead of a XLSX. I've tried using other numbers with the SaveAs() function, such as 1,4,8, I tried true. Some of those worked but none of them gave me the results I'm expecting. Is this type of task even possible to accomplish with ActiveXObject's and javascript? Any help is greatly appreciated!

/** IE 11 Only! **/
// ActiveXObject Example
var Excel = new ActiveXObject("Excel.Application");
Excel.DisplayAlerts = false;
var Book = Excel.Workbooks.Open(output_path+"file.xlsx");
Book.Worksheets("Sheet3”).SaveAs(output_path+"newfile.xlsx",6);
Excel_LI.DisplayAlerts = true;
Excel_LI.Quit();

1 Answer 1

1

Your answer is probably here somewhere, but there's a lot of different flavours of Excel listed. You may need some trial and error to figure out the one you need.

Sign up to request clarification or add additional context in comments.

1 Comment

Yup I found this site too, unfortunately the answer isn't obvious. However I managed to figure out, It's a 2. Thanks for your help @xarxziux

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.