Skip to content

ReadOnly (属性)

如果对象以只读方式打开,则返回 TrueBoolean 类型,只读。

示例

javascript
/*此示例演示如果当前活动工作簿是只读的,则将此活动工作簿另存为 Newfile.xls。*/
function test() {
    if (Application.ActiveWorkbook.ReadOnly == true) {
        Application.ActiveWorkbook.SaveAs("NEWFILE.XLS")
    }
}
javascript
/*此示例演示当前活动工作簿 ReadOnly 属性的数据类型。*/
function test() {
    console.log(typeof (Application.ActiveWorkbook.ReadOnly))
}