Skip to main content
Known Participant
Oct 15, 2021 1:54 PM UTC
Question

How <cfspreadsheet> to read a password protected excel file?

Hello All:

I tried to read password protected excel file by using this line of code

<cfspreadsheet action="read" query="MyControlPanelQuery" src="D:/LocalDocuments/FileName.xlsx">

I gave me this error "

An error occurred while reading the Excel: org.apache.poi.EncryptedDocumentException: The supplied spreadsheet is protected, but no password was supplied
"

I got this kind of error because the FileName.xlsx is password protected

The thing is "<cfspreadsheet action="read"....> doesn't any attribute to read a password protected excel file.

Any advice please?

 

Thank you

    This topic is closed to new replies. Start a new post to keep the conversation going.

    10 replies

    BKBK
    Community Expert
    Community Expert
    Oct 23, 2021 3:30 PM UTC
    EddieLotter
    Inspiring
    Oct 25, 2021 2:10 PM UTC

    Voted.

    Translate
    BKBK
    Community Expert
    Community Expert
    Oct 25, 2021 4:28 PM UTC

    Thanks, @EddieLotter .

    Translate
    BKBK
    Community Expert
    Community Expert
    Oct 16, 2021 9:24 AM UTC

     

    The thing is "<cfspreadsheet action="read"....> doesn't any attribute to read a password protected excel file.


    By @pham_mn

     

    Why do you say that? As @EddieLotter has said, cfspreadsheet has a password attribute. But, suppose Filename.xlsx is itself not password-protected. Then use as the value of the password attribute the password that offers read permissions D:/LocalDocuments.

    Translate
    EddieLotter
    Inspiring
    Oct 15, 2021 2:14 PM UTC

    Use the "password" attribute to provide the password.

    See the documentation for details.

    Translate
    pham_mnAuthor
    Known Participant
    Oct 17, 2021 10:28 PM UTC

    The <cfspreadsheet action="read"....> doesn't have password attribute...but the <cfspreadsheet action="write"..> does.

    This line 

    <cfspreadsheet action="read" query="MyControlPanelQuery" src="D:/LocalDocuments/MyControlPanelData.xlsx" headerrow="1" password="123">

     give me this error:

    Attribute validation error for tag CFSPREADSHEET.

    It does not allow the attribute(s) PASSWORD. The valid attribute(s) are ACTION,COLUMNNAMES,COLUMNS,EXCLUDEHEADERROW,FORMAT,HEADERROW,NAME,QUERY,ROWS,SHEET,SHEETNAME,SRC.
    Translate
    EddieLotter
    Inspiring
    Oct 18, 2021 2:30 PM UTC

    That sounds like a bug. Report it to Adobe and post your bug report number here so we can vote on it.

    Translate