I have an xlsm file that I need to insert data but my problem is that the xlsm in protected. I use the oWorkbook.Protect(,,.F.)
to unprotect but the function is not working. I s there any way to unprotect the file using the 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.)