How to create a cfspreadsheet with protected cells

前端 未结 1 1019
自闭症患者
自闭症患者 2021-01-19 19:32

I am creating a spreadsheet object using cfspreadsheet. Would like to make some of the individual cells as protected (read-only). Please let me know if anybody has tried thi

1条回答
  •  清歌不尽
    2021-01-19 20:10

    Locking a cell does nothing unless the sheet is protected ie using cfspreadsheet's password attribute. But doing so has some negative side effects ...

    Protecting the sheet locks all cells. That means you essentially have to "unlock" everything else by applying a format. In theory you could just unlock the entire sheet:

    
    

    However, that has the nasty effect of populating every single cell in the sheet. So if you read the file into a query, the query would contain ~65,536 rows and 256 columns. Even if you only populated a few cells explicitly.

    The lock feature is better suited to cases where you want everything to be locked except a few cells (not the reverse). Unless that is what you are doing, I probably would not bother with it, given all the negative side effects.

    Side effect example

        
        
        
        
    
        
        
        
    
        
        
    
        
    
            
        
    
        
    

    0 讨论(0)
提交回复
热议问题