Password protected excel file without encryption or zipping


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Password protected excel file without encryption or zipping
# 1  
Old 10-31-2017
Password protected excel file without encryption or zipping

All,

I have requirement to send password protected excel file in an email from unix/linux box without zipping it. Any help would be appreciated.

Thanks..
# 2  
Old 10-31-2017
You can protect an XLS spreadsheet using the Perl Excel::Writer::XLSX module, but you'll probably have to install it first.
This User Gave Thanks to Corona688 For This Post:
# 3  
Old 10-31-2017
Can you provide some more details on how to do it.
# 4  
Old 10-31-2017
I think, something like this, but I'm unable to test it:

Code:
#!/usr/bin/perl

use Excel::Writer::XLSX;

my $in=shift;
my $pass=shift;

my $workbook=Excel::Writer::XLSX->new( $in );
$workbook->protect($pass);
$workbook->close();

You put that in a file, set it executable, and run it like
Code:
./protect.pl filename.xls 'password'

# 5  
Old 11-01-2017
I just checked this module is not installed on unix server, Is there any other way of doing it?
# 6  
Old 11-02-2017
I don't know any others offhand and you're equally unlikely to have anything else. The feature you're asking for is third-party pretty much by definition.
# 7  
Old 11-02-2017
I have got this module installed but still it is not making the file password protected..

Using below code:

Code:
#!/usr/bin/perl


use strict;
use warnings;
use Excel::Writer::XLSX;


my $workbook  = Excel::Writer::XLSX->new( "TEST.xlsx" );
my $worksheet = $workbook->add_worksheet('TEST_FILE');
$worksheet->protect( 'drowssap' );
$workbook->close();

Moderator's Comments:
Mod Comment Please use CODE tags when displaying sample input, output, and code segments (as required by forum rules).

Last edited by Don Cragun; 11-02-2017 at 03:06 PM.. Reason: Add CODE tags.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Password protected excel file without encryption or zipping

All, I have requirement to send password protected excel file in an email from unix/linux box without zipping it. Any help would be appreciated. Thanks.. (1 Reply)
Discussion started by: Durgesh Gupta
1 Replies

2. Shell Programming and Scripting

DB Password encryption in config file

Hi Gurus, I need to encrypt the Db passwords which are stored in a configuration file (.txt) as below: stage_db_pwd=ABC this is test line content_db_pwd=123def This is test line 2 stg_db_name=xyz I want to encrypt all the password fields (identified by "pwd"), encrypt them in the same... (3 Replies)
Discussion started by: ashishpanchal85
3 Replies

3. Shell Programming and Scripting

Make a password protected bash script resist/refuse “bash -x” when the password is given

I want to give my long scripts to customer. The customer must not be able to read the scripts even if he has the password. The following command locks and unlocks the script but the set +x is simply ignored. The code: read -p 'Script: ' S && C=$S.crypt H='eval "$((dd if=$0 bs=1 skip=//|gpg... (7 Replies)
Discussion started by: frad
7 Replies

4. Shell Programming and Scripting

Password protecting a Excel file.

Hi, I want to make Excel files password protected present in my Unix directory. I have a application which will basically invoke a shell script with a parameter passed. The purpose of shell script would be to pop up a box to enter password. This password will be validated against database entry... (1 Reply)
Discussion started by: anil029
1 Replies

5. Shell Programming and Scripting

Unzipping files <password protected>

Hie Friends, I need your help once again. I have 77 “password protected” winzip files in linux/unix server. I want to decrypt it through an automated script. Password of every file is same and it is mhd*tt. Please help me. Usually I unzip it as follows, manually one by one. unzip <file name> ... (6 Replies)
Discussion started by: anushree.a
6 Replies

6. UNIX for Advanced & Expert Users

Problem in converting password protected excel file to csv file in unix

I need to convert a password protected excel file which will be in UNIX server to a comma separated file. For this I need to open the excel file in UNIX box but the UNIX box doesn't prompt for password instead it is opened in an encrypted manner. I could manually ftp the excel file to local... (2 Replies)
Discussion started by: Devivish
2 Replies

7. Shell Programming and Scripting

How to make script password protected

Hi All, I want to make my script password protected. i e: if somebody runs my script it should prompt for password. Can somebody help me in to execute the same?? Thanks in Advance :b: (11 Replies)
Discussion started by: achararun
11 Replies

8. AIX

File password protection/encryption

Can it be done? Ive read in a few places that the crypt program no longer exists on AIX...if its do-able please tell me how. (2 Replies)
Discussion started by: rdudejr
2 Replies

9. UNIX for Dummies Questions & Answers

Print on a printer which is password protected

Hi, I am trying to print from HP unix machine to a Toshiba printer which is password protected. How can I print? Thanks. Anuj (1 Reply)
Discussion started by: Anuj
1 Replies

10. UNIX for Dummies Questions & Answers

Zipping with password or encryption

We currently take files (via FTP) off of a mainframe and save them as a text file on our server. This is done via a script. The next thing that is done to that text file is it gets zipped (using ZIP). This all works fine, but it doesn't appear that ZIP (the free version) has any way to password... (2 Replies)
Discussion started by: dsimpg1
2 Replies
Login or Register to Ask a Question