Openoffice macro CellProtection
sub xinji
Dim oDoc as Object
Dim oSheet as Object
Dim oCell,oRange as Object
Dim p As New com.sun.star.util.CellProtection
dim aa , bb as string
aa = “A”
bb = “F”
oDoc = ThisComponent
oSheet = oDoc.Sheets(0)
‘oCell = oSheet.getCellByPosition(1,1)
‘ oRange = oSheet.getCellRangeByName(“B1:F10”)
oRange = oSheet.getCellRangeByName(aa & “1:”& bb &”10”)
‘p = oCell.CellProtection
p = oRange.CellProtection
p.Islocked = False
oRange.CellProtection = p
oSheet.protect(“xinji”)
end sub
{backbutton}
关注公众号『长空雪』
搬孕工 分享孕妇写真 关注我微信公众号 长空雪 “情而不色”是我公众号的风格