I am trying to unlock a password protected excel sheet using code found here
I am successfully able to unlock the excel file, but I do not want the user to see any wind
@Amelie:
Ret1 = FindWindow(vbNullString, "VBAProject - Project Properties")
If Ret1 <> 0 Then
ChildRet1 = FindWindowEx(Ret1, ByVal 0&, "Button", vbNullString)
If ChildRet1 <> 0 Then
strBuff = String(GetWindowTextLength(ChildRet1) + 1, Chr$(0))
GetWindowText ChildRet1, strBuff, Len(strBuff)
ButCap = strBuff
Do While ChildRet1 <> 0
If InStr(1, ButCap, "OK") Then
OpenRet1 = ChildRet1
Exit Do
End If
ChildRet1 = FindWindowEx(Ret, ChildRet1, "Button", vbNullString)
strBuff = String(GetWindowTextLength(ChildRet1) + 1, Chr$(0))
GetWindowText ChildRet1, strBuff, Len(strBuff)
ButCap = strBuff
Loop
If OpenRet1 <> 0 Then SendMessageA OpenRet1, BM_CLICK, 0, vbNullString
End If
End If