Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^4: protect excel file in perl script

by arunks (Novice)
on Jan 18, 2017 at 13:39 UTC ( [id://1179846]=note: print w/replies, xml ) Need Help??


in reply to Re^3: protect excel file in perl script
in thread protect excel file in perl script

do you have any sample code .please share it. am looking for before opening excel file prompt should ask for password to open the excel file.
  • Comment on Re^4: protect excel file in perl script

Replies are listed 'Best First'.
Re^4: protect excel file in perl script
by pryrt (Abbot) on Jan 20, 2017 at 14:44 UTC

    arunks, Corion gave you some good advice in the chatterbox, recorded here for posterity: "Maybe How do I make password prompts not echo back the user?? Or simply read it from STDIN".

    If I were to be solving the problem, especially after the advice already given in the thread, I would go to the documentation for Spreadsheet::ParseXLSX, which then directs you to the details in Spreadsheet::ParseExcel, which shows the syntax for giving options to the ->new(%opt) call. I would then code up the simplistic read-from-STDIN prompt (a single print and a single read from STDIN), and pass the result from that read into the the appropriate portion of Spreadsheet::ParseXLSX->new(%opt). Including using the modules, everything from using modules to instantiating the parser per the linked documentation took 6 lines -- and that's because I read into a variable instead of combining the read with the ->new(...), and counted the two lines for using strict and warnings.

    After you've made an honest attempt at writing those 6 lines for yourself, you might want to look at Tutorials, especially Getting Started with Perl and Basic debugging checklist. If you're still having trouble moving forward, post your code, along with what errors you are getting, and ask specific questions.

Re^5: protect excel file in perl script
by Lotus1 (Vicar) on Jan 20, 2017 at 15:25 UTC

    If you download the module Spreadsheet::ParseXLSX and look in the tests folder, 't', you'll find a file called encryption.t which has example code for opening password protected spreadsheets.

      ok I will try this. But before opening an excel file prompt should come and ask for password to open the excel file.am looking for password protection only not encryption the file.am seeing some cell value ..why is that. Please confirm. my $cell = $worksheet->get_cell(1, 1); is($cell->value, 'abcdefgABCDEFG');

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1179846]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-24 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found