Use CF add password to excel

Use poi how to add password to excel file.
http://kickjava.com/src/org/apache/poi/hssf/model/Workbook.java.htm
http://jakarta.apache.org/poi/apidocs/org/apache/poi/hssf/record/RecordInputStream.html
I am use this component for read and write excel
<!---
* Application: Excel workbook Component 0.1
* File Name: CFWorkbook.cfc
* CFC Component Name: CFWorkbook
* Created By: Wayne Deng
http://blog.waynedeng.com
* Created: 2006-3-5
* Description: A excel workbook component based on
HSSFWorkbook
http://jakarta.apache.org/poi/hssf/
--->
<cfcomponent name="CFWorkbook">
<cfscript>
this.HSSFWorkbook = "";
this.WorkSheets = ArrayNew(1);
</cfscript>
<cffunction name="init" access="public" output="false">
<cfset this.HSSFWorkbook =
createObject("java","org.apache.poi.hssf.usermodel.HSSFWorkbook").init()/>
<cfreturn this />
</cffunction>
<cffunction name="createSheet" access="public"
returntype="CFWorkSheet">
<cfargument name="sheetName" type="string"
required="false" default="">
<cfset var workSheet =
createObject("component","CFWorksheet").init(this)>
<cfset workSheet.sheetNumber =
ArrayLen(this.WorkSheets)>
<cfset this.WorkSheets[ArrayLen(this.WorkSheets)+1] =
workSheet>
<cfif arguments.sheetName neq ''>
<cfset setSheetName(workSheet.sheetNumber,
arguments.sheetName)>
</cfif>
<cfreturn workSheet>
</cffunction>
<cffunction name="setSheetName" access="public"
returntype="void">
<cfargument name="sheetNum" type="numeric"
required="true">
<cfargument name="sheetName" type="string"
required="true">
<cfset
this.HSSFWorkbook.setSheetName(JavaCast("int",arguments.sheetNum),
arguments.sheetName, this.HSSFWorkbook.encoding_utf_16)/>
</cffunction>
<cffunction name="saveToFile" access="public"
returntype="void">
<cfargument name="filePath" type="string"
required="true">
<cfset var fileOutStream =
createObject("java","java.io.FileOutputStream").init(arguments.filePath)/>
<cfset this.HSSFWorkbook.write(fileOutStream)/>
<cfset fileOutStream.close()/>
</cffunction>
<cffunction name="loadFile" access="public"
output="false">
<cfargument name="filePath" type="string"
required="true">
<cfset var fileIn =
createObject("java","java.io.FileInputStream").init(arguments.filePath)/>
<cfset var fs =
createObject("java","org.apache.poi.poifs.filesystem.POIFSFileSystem").init(fileIn)/>
<cfset var i = 0>
<cfset var workSheet = "">
<cfset this.HSSFWorkbook =
createObject("java","org.apache.poi.hssf.usermodel.HSSFWorkbook").init(fs)/>
<cfset this.WorkSheets = ArrayNew(1)>
<cfloop from="0"
to="#this.HSSFWorkbook.getNumberOfSheets()#" index="i">
<cfset workSheet =
createObject("component","CFWorksheet").init(this)>
<cfset workSheet.sheetNumber = i>
<cfset workSheet.HSSFWorksheet =
this.HSSFWorkbook.getSheetAt(JavaCast("int",i))>
<cfset this.WorkSheets[i+1] = workSheet>
</cfloop>
</cffunction>
<cffunction name="getColorIndex" access="public"
returntype="numeric">
<cfargument name="ColorName" required="true" type="string"
hint="">
<cfif arguments.ColorName neq ''>
<cfreturn
createObject("java","org.apache.poi.hssf.util.HSSFColor$#ucase(arguments.ColorName)#").ge tIndex()
/>
<cfelse>
<cfreturn 0>
</cfif>
</cffunction>
</cfcomponent>

You would have to get into the VBA programming in order to do
this. Why don't you just have a login function for the page with
these CFCs? That would restrict access to the Excel file.

Similar Messages

  • Issues using EPM Add- in for Excel

    Hello everybody,
    I have installed the EPM add-in for Excel 2010 in one of my client computers, but we're facing two different issues in this machine:
    1. Everytime he opens Excel the EPM add-in is disabled so he has to activate it each time he wants to use BPC.
    2. When he opens an activity from the BPF that is related to a Excel file it does nothing (this BPF works fine in other computers)
    I don't know if both issues are related but any ideas of why this could be happenning and how to solve them are welcome.
    Thanks in advance,
    Nidia

    Hi Nidia,
    Which version of excel are you using?
    .net 3.5 or .net 4 version of epm add in?
    maybe try the latest release, which is SP21 patch 1.
    Andy

  • Object reference error while using DM add-in in excel

    hi everyone!
    I instelled data mining add-in for excel 2013, tried to use it - several tools was available, other needed MS SQL Server - i installed it too, connected Excel to Server and now a can't use this add-in at all. All i see is error "Object reference not
    ser to an instance of an object".
    Excel 2013 64 bit
    MS SQL Server 2014 Trial version 
    Powerpivot included
    Thank you in advise!

    did u deploy your dbadapter through console to the plan mentioned for deployment?

  • Is it possible to use an add-on to Excel in Numbers?

    I use a data feeder that has been created only for excel. Is it possible with a plugin to use this in Numbers?

    This is an own developed plug-in. It is actually an XML service from an Oracle database. So I'm looking for a way to integrate a little tool that works only for Excel to Numbers .

  • Error log in BI Add-in from Excel

    I have Oracle BI Add-In for Microsoft Excel, v 1.0.3027.22876, installed. I can see "Oracle BI" icon in Excel tool bar. I tested connection by clicking Oracle BI/Preference/Connection Detail/Test Connection, it said "Test connection successful". But when I tried to login from Excel, I got an error message "Unknown error occurred". What could be wrong?
    I have Excel 2003.

    I don't have BI server installed on my computer. I searched websites and tried to find more info on bioffice.war. Not sure whether I am right, think I can see this file only if I have BI server installed on my pc.
    By the way, I downloaded BI add-in program from BI Analytics web version. I had used BI add-in in Excel for a few months. But about a month ago, when I tried to log in, it just gave me the unknown error message.

  • How to get the password of a password protected Excel Sheet using java/jxl

    Hi ,
    how to get the password of a password protected Excel Sheet using java / jxl program.
    plz any one help me .
    Ramesh P
    [email protected]

    If they've implemented the password system correctly there probably isn't a way of getting the password at all.

  • Password protected Excel file generation using Java

    Hi,
    I want to create password protected excel file using Java. So when you manually open this file it should prompt for password.
    There are APIs but they are licensed and are for trial period. I want solution which is free.
    I need this solution urgently..
    :-)

    Swati.S wrote:
    Hi Administrator,
    Moderator. Administrators post with the Sun logo.
    I'm sorry I wasnt aware that we cannot have off forum communication. Can you please communicate how I can spread this message taht solution for this is available.If you like, you can post the code here or on [SDN Share|http://sdnshare.sun.com/]. Apart from that, there's no shortage of blog sites.

  • Excel data source and the use of add command

    HI, Looking for suggestions on how to work with multiple inputs that cannot be joined directly.  Here's the background.
    The Report currently reads in two different Ecel files and uses 3 SQL commands to query an Oracle Database.  I need to join the 5 data sources and am having issues with the 2 excel files.  In one file I need to be able to derive a field based on another column in the file In order to create the join condition to the SQL commands.  I'd equate this to a case statement in SQL, but how goes one do that using the 'add command' feature?  What is the syntax?
    Next I would need to join (left outer) the two excel files using two fields from file A (a1, a2) and 3 fields from file B (b1,b2,b3), where a1=b1 and b2 <= a2  <= b3 when rows from A exist in B.  If row A does not exist in B then we still want it in the report and available to left outer join to the 3 oractab data sources.
    runtime is also a concern.
    Any Suggestions?

    hi Elena,
    in this case the use of subreports is not recommended. that's because you're exporting to excel and you need data in columns across the report. subreports will not, unfortunately, give you what you need.
    this would bring you back to joining the datasources. what i would recommend is looking into using 'oracle database link' to link your oracle db to excel files. here's one article as an example but you may be able to find a better one. if you have questions on this please ask them on an oracle forum as the syntax that you need will be database specific.
    a lot of databases have this type of technology which allows you to create a view to other data. sql server has 'linked servers', sap hana has 'smart data access'. essentially you are creating a non-materialized view to the external data. then this view is available on the main oracle server where you established this connection. this should be a lot easier than trying to bring a bunch of command objects together off independent datasources inside of crystal.
    -jamie

  • Use labview to read an Excel file to some control and add a checkbox for each row

      As the subject say,I need to use labview to read an excel file,and show it in some control,such as mclb;then ,I should add an checkbox for each row,enable me to choose the row i want.What should I do ? Many Thanks.
    Solved!
    Go to Solution.

    Hi,
    to answer your question:
    - read an excel file
    - show it in some control, such as a MCLB
    - add an checkbox for each row
    - choose the row you want
    Hint to make it easier: I wouldn't use checkboxes, as the MCLB already allows to select rows by mouseclick…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • I've been using a master password for years. Today I noticed that it had been cleared. What could cause this?

    I've been using a master password for years. I also use Sync. Today I wanted to look up one of my saved passwords. When I went to do this I noticed that Firefox was no longer set to use a master password. I'm afraid that I may have been hacked, or that something else happened (recent Firefox update?) that caused the use of the master password to be disabled.
    I have not yet checked my other Synced computers to see if their master passwords have also been turned off.
    I have re-enabled the master password feature on this computer.
    On this particular computer, I've had a long-standing issue where Firefox "Help>About Firefox" always shows that I need to "Restart to Update". This means that I cannot use "Help>About Firefox" to check for and install the latest version. I need to download Firefox manually and update by running the installer.

    Hi,
    You can try to '''Clear Now''' the '''Active Logins''' with '''Time range to clear''' set to '''Everything''' via '''Tools''' ('''Alt''' + '''T''') > [https://support.mozilla.org/en-US/kb/Clear%20Recent%20History Clear Recent History]. Alternatively via '''Tools''' ('''Alt''' + '''T''') > '''Options''' > [https://support.mozilla.org/en-US/kb/Options%20window%20-%20Advanced%20panel?as=u Advanced] > '''Encryption''' > '''Security Devices''', select '''Software Security Device''' and choose '''Log Out'''. You can then restart Firefox and check.
    If the problem persists you can reset Firefox and start afresh.
    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!
    If you would like to take a listing of the add-ons, changed preferences/settings etc. to quickly replicate the previous profile, please '''Copy all to clipboard''' (on the left of the reset button), and paste it into MS Office Excel, or OpenOffice/LibreOffice Calc, or notepad. However, it would be a good idea to check for the existence of the issue immediately after the reset.
    For the update error, please try searching for all instances of '''updates.xml''', open the containing folder to make sure it belongs to Firefox/Mozilla (path) and delete all instances of the file along with the '''updates''' folder.

  • Known issues for OBIEE Office Add in with Excel 2007?

    Hi,
    Does anybody know if there are issues for the office add-in with Office 2007?
    i'm playing around a little bit to see how it works, but it seems that Excel interferes with the layout.
    I do get different grafs and also i tried the tutorial with the excel template and my changes come only partly through.
    Thanks
    Sandra

    Hi Sandra,
    Were you able to use OBIEE Office Add in with Excel 2007? I am planning to look at this compatibility. I am looking here to seeif anyone found issues with this setup..
    Thanks,
    Bharat

  • How to show ipad application in itunes, but will only be assessable to owners, not the general public.Using lock code/password protected on iTunes

    How to show ipad application in itunes, but will only be assessable to owners, not the general public by using lock code/password protected on iTunes

    So if I understand you properly, I need to create EOs for all my list of values (which are based on views of Oracle apps tables) and base my VO on those EOs. And then I setup associations between these EOs and the Item EO. Then I include the these EOs in my Items VO and add the description attributes to my list of attributes. I had done this for the list of users, but for the views of Oracle I had just created read only VO. Sounds like that won't work if I want to display the description. I know what to do - I guess I was hoping there was a way to use the read only VO.
    Thanks
    Karen

  • Acrobat 9.0 Standard. Setting PDF file password from Excel VBA

    Acrobat 9.0 Standard. Setting PDF file password from Excel VBA
    Hi: I am trying to find a call to set the password of a PDF file that I am creating from Excel Workbook using a VBA call.
    I basically have this Excel VBA code that works fine and creates a file.
                pBook.PrintOut Copies:=1, preview:=False, ActivePrinter:="Adobe PDF", _
                               PrintToFile:=True, collate:=True, PrToFileName:=PSFileName
                ' Convert the postscript file to .pdf
                Dim myPDF As PdfDistiller
                Set myPDF = New PdfDistiller     
                myPDF.FileToPDF PSFileName, "", ""
    BUT, I need to set the password on this PDF file and do not see an option to do so.
    Can you provide a solution for this situation? Appreciate your response in advance.
    Thanks.

    There is no way to set password programmatically using any other dll or any other kit?
    I am creating a bunch of PDF files for users programmatically but then they have to go in and set password themselves? This is very inconvenient for users.

  • Master Data Services Add-in for Excel Issue

    I am trying to configure MDS in the Production server. I am running into isssues.
    (I was able to do the whole process successfuly in my local system - Versions are same in the local and server - Only difference is local machine is windows 7 server is Windows 2008 R2)
    I have installed SQL server 2012 Enterprise Version SP1. I am able to browse the MDS URL. User has got full permissions. When I try to access the MDS via Excel I get the below error.
    Can any one help me please I have spent days on this withou any joy.
    Error message
    TITLE: Master Data Services Add-in for Excel
    An error occurred while receiving the HTTP response to
    http://MYIPADDRESS/mds/service/service.svc/bhb. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See
    server logs for more details.
    ADDITIONAL INFORMATION:
    The underlying connection was closed: An unexpected error occurred on a receive. (System)
    Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. (System)
    An existing connection was forcibly closed by the remote host (System)
    BUTTONS:
    OK
    Bn

    I have finally found a solution for this problem!  Every time I opened Excel (unless I ran as administrator) I would have to activate the MDS add-in; this was time-consuming and annoying. It seems like there was no solution posted online anywhere! Well
    after much aggravation, I have finally found a solution:
    Fixing the Microsoft MDS Excel Add-In so it Stays Enabled
    Press the Start button (Windows button)
    In the search bar type “REGEDIT”
    Open regedit.exe
    A pop-up will ask permission for the Registry Editor to make changes to the computer, select Yes.
    In the Registry Editor expand HKEY_CURRENT_USER
    In the HKEY_CURRENT_USER folder, expand in the following order:  Software -> Microsoft -> Office -> Excel -> Addins
        Select Microsoft.MasterDataServices.ExcelAddIn
    Double-click on LoadBehavior in the right panel
        In the Edit Value popup, change the value to 
    Press OK
    Exit the Registry Editor
    The excel add-in should now be active anytime you open Excel. If multiple errors occur while using the add-in, the Load Behavior may change back to 0.  If that occurs simply follow these steps so the add-in will be active when Excel starts up.
    I hope this helps some of you avoid the long hours of trying to find a solution to this silly problem.
    Cheers!
    Tony

  • How do I enable the button to use the tree list in excel? (Enable the list type: Tree enabled in Office 2013 - VSTF 2013)

    Hi, I was looking to see if anyone knows how I can troubleshoot my connection problem with TFS view in excel. I'm trying to  produce a tree view in Office 2013 as described in the following KB -
    https://msdn.microsoft.com/en-us/library/dd286627.aspx
    I have followed the instructions on the KB all the way up to : 'Add backlog items and tasks and their parent-child links using a tree list' and at this point I can't seem to get it to work as the button is greyed out.
    Note that I have completed steps 1-6 for the previous procedure... all 6 steps work just fine. However on step 2 of the second procedure - the instructions state I should be able to 'Add Tree Level' - However the button is greyed out.
    Anyone know what I need to do to enable the button to use the tree list in excel? 
    Frank

    Frank,
    I believe your issue is that you have opened a Flat query and are trying to add tree levels. A flat query is just that and you cannot change the query type from Excel.
    The second process is managing a backlog (which is a tree). TFS web access has a link on the backlog view to create a query. That query will be a "tree of work items" query that returns the items in the backlog including their parent-child relationships.
    This type of query supports the Add Tree Level and Add Child functionality as does a new Input List (not bound to an existing query).
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

Maybe you are looking for

  • Sql query is taking more time

    Hi all, db:oracle 9i I am facing below query prob. prob is that query is taking more time 45 min than earliar (10 sec). please any one suggest me ..... SQL> SELECT MAX (tdar1.ID) ID, tdar1.request_id, tdar1.lolm_transaction_id, 2 tdar1.transaction_ve

  • Connecting XI with other XI using SOAP adapter, is it possible?

    Hi all, I know that for connection between XI’s is recommended using XI connectivity adapter. But I want to send/receive messages trough other XI outside of my network and I’m thinking using SOAP adapter for effect. Is it possible? Thanks in advance.

  • HOW CAN I STREAM I TUNES PURCHASED MOVIES TO A GM FACTORY DVD SYSTEM WITH RCA IN

    Having trouble finding away to stream i tunes purchased movies to a gm factory dvd system that has rca in only. I have the lightning cable to hdmi but can not find any reliable info on a way to convert to analog out (rca) I also own the apple tv2 but

  • Sorted directories can't be copied-- the order is lost

    I put this question in the regular Bridge Forun, but nobody was answering, so I thought it might be better here. I cannot copy a sorted directory of images and have the new directory retain the sort order. If I have all my images in a given directory

  • Create playlist from iPhone

    Every time I create or add to a playlist on my iPhone, it makes a duplicate playlist once it syncs with my Macmini. Example; I'll have a playlist called "Alternative" and if I add to it from my iPhone all is fine until I sync. It will then create ano