弄好了,是问deepseek解决的代码如下:
mymm=ALLTRIM(thisform.text1.Value)
oWorksheet.Protect(;
mymm,
; && Password(空字符串表示无密码)
.T.,
; && DrawingObjects(允许修改图形)
.T.,
; && Contents(保护内容)
.T.,
; && Scenarios(保护方案)
.F.,
; && UserInterfaceOnly(False)
.F.,
; && AllowFormattingCells(设为.F.,因为单独控制行列格式)
.T.,
; && AllowFormattingColumns(允许列格式)
.T.,
; && AllowFormattingRows(允许行格式)
.F.,
; && AllowInsertingColumns(禁止插入列)
.F.,
; && AllowInsertingRows(禁止插入行)
.F.,
; && AllowDeletingColumns(禁止删除列)
.F.,
; && AllowDeletingRows(禁止删除行)
.T.,
; && AllowSorting(允许排序)
.T.,
; && AllowFiltering(允许筛选)
.T.
; && AllowUsingPivotTables(允许数据透视表)
)
&&限定结束