发布网友 发布时间:2022-04-23 02:41
共1个回答
热心网友 时间:2023-05-18 12:38
Function UnprotectXL(filePath,fileName,pwd,writeresPwd)
Set objExcel=CreateObject("Excel.Application")
objExcel.Visible=false
testData=filePath&"\"&fileName
Set oWorkbook=objExcel.Workbooks
Set myWkbook=objExcel.Workbooks.open (testData,0,False,5,pwd,writeresPwd)
objExcel.DisplayAlerts=False
oWorkbook(fileName).Activate
For Each w in objExcel.Workbooks
w.SaveAs testData,,"",""
Next
objExcel.Workbooks.Close
objExcel.Quit
Set oWorkbook=Nothing
Set objExcel=Nothing
End Function