Applying Subtotal and Changing Direction of Outline Summary Rows Below Detail

Images of source and output files

The following screenshot shows the source Excel file used in the sample code below, which contains some data in columns A and B.

todo:image_alt_text

The following screenshot shows the output Excel file generated by the sample code. As you can see, a subtotal has been applied to range A2:B11, and the outline direction is set to summary rows below detail.

todo:image_alt_text

Node.js code to apply a subtotal and change the direction of outline summary rows

Here is the sample code that produces the output shown above.