先选中单元格,把属性里,保护的锁定去掉
然后选你要只读的单元格或区域,把属性里,保护的锁定选中。
然后
工具——保护——保护工作簿,输完密码后完成。
java里操作的话,看看这个:
http://hi.baidu.com/2388451/blog/item/f2e525fa2ecf1b9659ee9099.html

解决方案 »

  1.   

    你说的我也看了,就是找不到解决的办法,对一个sheet对象里的操作好象就那么几个,我没找到控制属性的方法
      

  2.   

    首先你用
    setLocked
    public void setLocked(boolean locked)set the cell's using this style to be locked Parameters:
    locked - - whether the cell using this style should be locked
    将你的全部单元格锁定方法参数为(true),然后用
    setPassword
    public void setPassword(short password)set the password Parameters:
    password - representing the password
    =====
    将sheet页保护,还有方法setProtect
    public void setProtect(boolean protect)set whether the this is protected shared/tracked workbook or not Parameters:
    protect - whether to protect the workbook or not
    ================参数分别为true和false估计就是用来保护或解保护的.
    然后判断用户的权限1,2,3,4,5,6分别给他解开对应的单元格
    =========================================================
    还有一种办法就是你做n个表,每个表都做成一种模板形式,每个模板根据不同用户把相应的单元格的locked去掉,其他的都locked起来,根据用户的情况分别给他提供对应的模板,这样你只需要在程序中自己去解保护,而用户拿到的永远是保护起来的,只不过他的填写部分没有被锁定
      

  3.   

    如何在Java内嵌入Excel
    http://blog.csdn.net/bovy/archive/2007/04/06/1554644.aspx
    如何在Java内读取COM接口中所有的方法和属性?
    http://blog.csdn.net/bovy/archive/2007/04/09/1557256.aspx
    把Word/Excel/Power Point嵌入到Java程序内
    http://blog.csdn.net/bovy/archive/2007/04/06/1554447.aspx