From a2ffc47d7589eb6e9d0cecf880ec1c84ddfd8316 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sun, 20 May 2012 14:28:22 +0900 Subject: more work on sheet protection. Protection is working, but specifying a password does not work. Having a bit of trouble implementing the hashing algorithm... --- examples/sheet_protection.rb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 examples/sheet_protection.rb (limited to 'examples') diff --git a/examples/sheet_protection.rb b/examples/sheet_protection.rb new file mode 100644 index 00000000..be6cf677 --- /dev/null +++ b/examples/sheet_protection.rb @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby -w -s +# -*- coding: utf-8 -*- +$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib" +require 'axlsx' + +p = Axlsx::Package.new +p.workbook.add_worksheet { |ws| ws.sheet_protection.password = 'fish' } +p.serialize 'sheet_protection.xlsx' -- cgit v1.2.3