0

我有一个需要插入数据的 xlsm 文件,但我的问题是 xlsm 处于受保护状态。我使用oWorkbook.Protect(,,.F.)取消保护但该功能不起作用。我有什么方法可以使用 foxpro 取消保护文件?

oExcel = CreateObject("Excel.Application")
**checking if the excel installed into the computer
if vartype(oExcel) != "O"
    MESSAGEBOX("could not instantiate Excel object.")
  return .F.
ENDIF

oExcel.DisplayAlerts = .F.
oExcel.visible=.T.
**opening the data File
oWorkbook = oExcel.Application.workbooks.open(SYS(5)+SYS(2003)+"\WebADI Template\WebADI.xlsm")
**unprotect the workbook
oWorkbook.Protect(,,.F.)
4

0 回答 0