summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-05-20 14:28:22 +0900
committerRandy Morgan <[email protected]>2012-05-20 14:28:22 +0900
commita2ffc47d7589eb6e9d0cecf880ec1c84ddfd8316 (patch)
treed114f238ba6d9e015709b97c330237ed11eb5a67 /examples
parent0aede23fd2d8649bce223b36c28e5c77bf3749c4 (diff)
downloadcaxlsx-a2ffc47d7589eb6e9d0cecf880ec1c84ddfd8316.tar.gz
caxlsx-a2ffc47d7589eb6e9d0cecf880ec1c84ddfd8316.zip
more work on sheet protection. Protection is working, but specifying a password does not work. Having a bit of trouble implementing the hashing algorithm...
Diffstat (limited to 'examples')
-rw-r--r--examples/sheet_protection.rb8
1 files changed, 8 insertions, 0 deletions
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'