fitaliano
asked on
Calling Excel functions from Access
I am trying to open and unprotect an excel from Access, I have the following code which opens the file but I am not able to unprotect once it is open. Could you help me to fix it? It would be fantastic if I could unprotect/protect without opening the file.
Dim xlAp As Excel.Application
Dim xlWB As Excel.Workbook
Set xlApp = New Excel.Application
With xlApp
.Visible = True
Set xlWB = .Workbooks.Open("C:\WFRepo rts_CG.xls ", , False)
Set xlWB = .ThisWorkbook.UnProtect("1 0111213141 5161718191 a1b1c")
End With
Dim xlAp As Excel.Application
Dim xlWB As Excel.Workbook
Set xlApp = New Excel.Application
With xlApp
.Visible = True
Set xlWB = .Workbooks.Open("C:\WFRepo
Set xlWB = .ThisWorkbook.UnProtect("1
End With
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dim xlAp As Excel.Application
Dim xlWB As Excel.Workbook
Set xlApp = New Excel.Application
With xlApp
.Visible = True
Set xlWB = .Workbooks.Open("C:\WFRepo
.ActiveWorkbook.UnProtect ("101112131415161718191a1b
End With