如何解除EXCEL表的锁定状态呢?
我在将EXCEL表中数据转到数据库表之后再打开原来的EXCEL表时显示EXCEL表被锁定了,如何在导入数据后解除对EXCEL表的锁定呢?源程序如下:local oExcel,oWorkBook,oSheet
local cFilePath
public cFieldName,cFieldVal
oExcel=createobject("excel.application")
oExcel.visible=.f.
cFilePath=getfile("xls")
IF EMPTY(cFilePath)
messagebox("请选择excel文件")
RETURN
ENDIF
oWorkBook=oExcel.workbooks.open(cFilePath)
oSheet=oWorkBook.sheets(1)
set safety off
use dwlszb exclusive
zap
for iRow=1 to oSheet.usedRange.rows.count-1
append blank
for iCol=1 to oSheet.usedRange.columns.count
cFieldName=oSheet.cells(1,iCol).text
cFieldVal=oSheet.cells(iRow+1,iCol).value
replace &cFieldName with cFieldVal
endfor
endfor