module RubyXL::LegacyWorkbook

def save(filepath = nil)

Save the resulting XLSX file to the specified location
def save(filepath = nil)
  filepath ||= root.filepath
  extension = File.extname(filepath)
  unless %w{.xlsx .xlsm}.include?(extension.downcase)
    raise "Unsupported extension: #{extension} (only .xlsx and .xlsm files are supported)."
  end
  File.open(filepath, "wb") { |output_file| FileUtils.copy_stream(root.stream, output_file) }
  return filepath
end