How do I save excel file with password for read only access ?

Hi
I am trying to save an excel file with a password to make it read only when opened
using OLE2 . I am having a problem with the parameter list. This is my code that does
work.
args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, 'C:\Reports\Excel\File.xls');
ole2.add_arg(args, 0);
ole2.add_arg(args, 0);
ole2.add_arg(args, 'TEST');
ole2.add_arg(args, 0);
ole2.add_arg(args, 0);
ole2.add_arg(args, 1);
I also have the following code at the beginning of the program to suppress dialogs.
     OLE2.SET_PROPERTY(application,'DisplayAlerts', 'FALSE');
     ole2.set_property(application,'Visible', 'false');

Hope it help.
     -- Begin : Protect your worksheet
     args := OLE2.CREATE_ARGLIST;
     OLE2.ADD_ARG(args,yourpassword); -- choose your password
     OLE2.INVOKE(worksheet, 'Protect', args);
     OLE2.DESTROY_ARGLIST(args);
     -- End : Protect your worksheet
     -- Begin : Save and close worksheet
     OLE2.INVOKE(workbook, 'Save');
     OLE2.INVOKE(workbook, 'Close');
     -- END : Save and close worksheet

Similar Messages

  • How to open an excel file with password in Crystal Reports XI  Release 2

    I have a problem when i try to open an excel 2003 file with password that i know
    i recevived an error code 0xc59
    How can I open a file in excel 2003 protected by password to create the report?
    Thanks in advanced

    Hi Pierluigi,
    It looks like you have to open the excel file and use the data.
    A few informative links.
    http://support.microsoft.com/kb/257819#RetrieveExcel
    http://support.microsoft.com/kb/211378/EN-US/
    Hope this helps.
    Regards,
    Abhijeet Taskar.

  • How do I save excel file with new name?

    Returning to using a Mac after 20 years - so not familiar with many things.
    I have an existing Excel file that I am using and making changes to... how do I save it as a new file name?
    I click on the 'disk' icon on the top ribbon but that just saves it as the same file-name with an updated time-stamp... that won't work for me.
    Much appreciate any help!

    Top of screen: FILE -- Save as... Name it - top rectangle and pick a place to save it. DONE.

  • There is no 'Save as' under the file menu.  How do I save a file with another name?

    Numbers help refers to the 'Save As' function in the File menu.  My version (latest) does not have a 'Save As' function.  How do I save a file with another name?

    Ross Millard wrote:
    Badunit. You have an original file and an edited file. Now you duplicate the edited file and save it with a different name. Now do you have to go and delete the changed file from which the duplicate had been made? And.... is the original still unchaned... still original?
    Ross,
    For the situation you describe, Apple has provided Duplicate and Revert. Use File > Duplicate to reach this menu:
    Regards,
    Jerry

  • In Pages how do I save a file with another name

    In Pages how do I save a file with another name?

    I don't know if there is a less cumbersome way to do this (I'm still pretty new to Lion) but This is what I do - since "Save As" seems to be gone with Lion.
    I create a duplicate document - then click the red button to close the document - and a dialog box pops up and asks if you want to save the changes - I change the name in there and then save the file under the new name.
    You can also save the copy to the desktop - get info - and then change the name if the finder window.
    I copied this from the Pages help area. These help instructions were created pre-Lion I'm sure.
    Saving a Copy of a Document
    If you want to make a copy of your document—to create a backup copy or multiple versions, for example—you can save the document using a different name or location. (You can also automate saving a backup version, as Automatically Saving a Backup Version of a Document describes.)
    To save a copy of a document: 
    Choose File > Save As and specify a name and location.
    The document with the new name remains open. To work with the previous version, choose File > Open Recent and choose the previous version from the submenu.

  • Can/How do you save excel files to the cloud?

    How, if at all, can you save excel files to icloud?

    I think you need to upgrade your MacOS.  Mine is running MacOS X 10.8.4. 
    I am running Numbers '09 v2.3.
    Need to sign on to iCloud under Mac Preference Settings.
    When I start Numbers, I can view files stored on iCloud, or locally on the Mac harddisk.
    Hope it helps.

  • How can you save a file with CS4 so that it can be opened with CS3?

    I fave a file that I have sent someone, but they can't open it because they don't have CS4. How can I save a file, using CS4, so that the file can be opened with CS3?
    Thanx

    From the help file: http://help.adobe.com/en_US/Illustrator/14.0/WS714a382cdf7d304e7e07d0100196cbc5f-655fa.ht ml

  • How to store an Excel file in InfoPath for users to edit

    Hello,
    I need an example on how to store an Excel file within InfoPath 2010 so that every time a user opens the InfoPath form they can make changes and can save as part of the form. The next user opens the form and another Excel files (blank) where they make changes and
    saves. Thanks

    Streamlining this would require a bit of custom work I imagine. However if you don't mind giving the users some extra clicks, there are probably a few ways to get the job done.
    You could upload the excel file to SharePoint, make sure it's read-only and link to it within the InfoPath form. Then the process would be that users open the InfoPath form, fill it out, download the excel doc to their desktops and fill it out, and then
    attach it to the IP form.
    Or you could set up a separate, sister library where the New Item defaults to your Excel template. Then from within the InfoPath form you could have a hyperlink that creates the new item, saving it to the library. The caveat here is finding a way to link
    to the two items together with a unique identifier. The benefit though is being able to browse and interact with Excel docs independent of the forms they are attached to, if necessary.

  • How do I save a file with SAVE AS rather than SAVE A VERSION?

    I have entered data on a template file and wish to SAVE AS a named file. Pages gives me only one option "Save a Version" which saves the template file overwritten. What has happened to "SAVE AS"

    Just discovered this "feature" myself and I'll also be filling in a feedback form to point out what an appalling idea this was.  When I read that "Save As..." has been totally removed, can't even be activated as an option, I shook my head.
    "Save As..." has been used in every program I can think of, cross-platform, for decades. It's as fundamental to the user experience as "Open File", "Close Window" or even "Save". It's like Apple deciding on a whim that a little cross is too boring for closing windows, let's make it a swirl instead - except users don't understand what it means.
    My main problem (and maybe someone here can help me with a workaround) is that I often open an old file and tinker with it, then decide I'm making more changes than I thought etc. and it might be better to keep the original and "Save As..." to create a new document. From what I can see, if I hit "Duplicate" I'll end up with 2 files that have my recent changes.  I'll then have to rename the new "Duplicate" file and go back and "Undo" all my recent changes in the original until I'm back to the start (or use "Revert").  Fail to see a way around this and it's such a fundamental problem that will literally hamper my use of Pages on a daily basis, that I'm seriously considering buying Word (what a horrible prospect!).

  • Attach an Excel File with Email for External Email Address

    Hi,
    I want to send an excel file to an external email address as an attachement.
    I am using the function module SO_NEW_DOCUMENT_ATT_SEND_API1 for sending the email.
    But as far as I know we can only create and send the excel file in this FM. e.g. we can put the text manually and name the file as excel and add it as packing list and send the document.
    Now, my client has a template in excel/word which he wants to send as an attachment always when he sends the mail. I have below Queries:
    1. Where and how do i store the template which is in Excel or word? He doesnt want to upload the template each time he runs the report. Can I save the file on AL11? how do i insert the file in this?
    2. I have tried standard texts, but his template contains a logo. So, I am not sure if that would work. Can I send the template in Binary and just aapend the file extension? xls or doc? would that do?

    Hi,
    See if you can matintain the required templates in document management and use them in your reports.
    Try the link below for reference.
    [Document Management|http://wiki.sdn.sap.com/wiki/display/PLM/Templates-Document+Management]]
    Regards,
    Booma

  • My Excel files were imported as read only files how can I change these

    I am a new Mac user. When my excel files were copied over from my MS PC they have come over as read only files. How can i change these to "normal" files as they were on my PC? Thanks

    More info:
    Version: 10.6.8
    Format: Mac OS Extended
    Sharing & Permissions:
    system - Read & Write
    admin - Read & Write
    everyone - Read only
    When I click the lock in the bottom right corner it prompts me for my password but after unlocking it it doesn't allow me to change privelages or give me any new permissions.

  • Unable to save Excel file with RMS feature enabled.

    We have a client who is unable to save a protected workbook. If he disables RMS he is able to save. I have tested this and it is not system wide. I have included a few errors he was getting. This user has Office 2010 running on Windows 7. He has verified
    he is connected to the Domain.<v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe"
    stroked="f"><v:stroke joinstyle="miter"><v:formulas>h  <v:f eqn="if lineDrawn pixelLineWidth 0">
      <v:f eqn="sum @0 1 0">
      <v:f eqn="sum 0 0 @1">
      <v:f eqn="prod @2 1 2">
      <v:f eqn="prod @3 21600 pixelWidth">
      <v:f eqn="prod @3 21600 pixelHeight">
      <v:f eqn="sum @0 0 1">
      <v:f eqn="prod @6 1 2">
      <v:f eqn="prod @7 21600 pixelWidth">
      <v:f eqn="sum @8 21600 0">
      <v:f eqn="prod @7 21600 pixelHeight">
      <v:f eqn="sum @10 21600 0">
     </v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas>
     <v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f">
     <o:lock aspectratio="t" v:ext="edit">
    </o:lock></v:path></v:stroke></v:shapetype><v:shape alt="" id="Picture_x0020_1" o:spid="_x0000_i1025" style="width:881.25pt;height:135.75pt;" type="#_x0000_t75">
    <v:imagedata o:href="cid:[email protected]" src="file:///C:\Users\btate\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png">
    </v:imagedata></v:shape>

    I had this issue a while ago.
    We solved the problem by running windows update and installing all office updates.
    Hope it will help

  • How can i save a file with FileDialog?

    hi,
    i watched the forum but didn't find an answer to my problem. what i want is that after a klick on a button the FileDialog should appear. then i want choose a directory and enter the name for the new file.
    then after clicking the ok button of the filedialog frame, i want to get the file name, which was entered, to create the new file and to store the data in it.
    there must be a way, if not for what is the FileDialog good. ;-)
    greets darkPsy

    Use the FileDialog methods getFile() and getDirectory(). In the code I used, I just concatenated the directory and file and used that String as the file name for a FileReader.

  • Decompress ZIP file with Password

    Hi all,
    Does anybody know how to decompress a ZIP file with password protection?
    I have a decompress code, but I don't know how to insert the pass.
    Any solution?
    Regards

    I'm running out of suggestions over here.
    Your exact command line yields this result:
    zip warning: name not matched: in.txt
    zip error: Nothing to do! (out.zip)
    Well, it should, as I don't have an in.txt. Handing it an existing file, I get this:
    zip -P pass out.zip result.txt
      adding: result.txt (deflated 7%)
    .. and opening in the Finder correctly prompts me:
    so there must be something wrong with your system.
    Very Long Shot: What version do you get when you type this? (I can't imagine this is the actual problem, but you never know.)
    zip --version
    Mine is
    Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
    This is Zip 3.0 (July 5th 2008), by Info-ZIP.
    Currently maintained by E. Gordon.  Please send bug reports to
    the authors using the web page at www.info-zip.org; see README for details.
    Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip,
    as of above date; see http://www.info-zip.org/ for other sites.
    Compiled with gcc 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) for Unix (Mac OS X) on May 25 2011.

  • I want to save a username and Password for an app on my i phone

    How can I save my username and password for an app on my  i phone so as I dont have to type it in everytime I want to open my app

    This has to be an option in the app.
    You cannot set it elsewhere.

Maybe you are looking for

  • RCA Adapter

    Why can't I use a dvi to rca adapter on a g4? I'm trying to use a tv as a second monitor. I can do this on my g5 with fcp5. On my g4 I want to do the same thing for ae6. The adapter says for a g5. But what difference does it make. Is the signal diffe

  • ICloud missing from my system preferences

    I recently changed my email for my apple ID log in and since doing that I keep getting an error that pops up to fix my apple ID and password for my icloud. When I click to update it takes me to system prefferences and gives me a NULL error. I have OS

  • Connecting External hardrive

    i connected my external hardrive to the airport but it will not pull it up on the computer how come?

  • Stonlen iPod

    My iPod was stolen how do i track it down? is there a way to find out where it is?

  • Jsessionid string replacement

    Can i remove the URL String part jsessionidand replace it with asdfsessidfor exnample? is there some configuration (XML) code?