Sets the password upon login, and logs the user out.
EssVLoginSetPassword (sheetName, newPassword, oldPassword, server, userName) ByVal sheetName As Variant ByVal newPassword As Variant ByVal oldPassword As Variant ByVal server As Variant ByVal userName As Variant
Text name of worksheet to operate on. sheetName is of the form "[Book.xls]Sheet". If sheetName is Null or Empty, the active worksheet is used.
Text name of the password you want to set for the user name.
Text name of the old password to replace for the user name.
Text name of the server you want to change the password for.
Text name of the user name on the server.
Returns 0 if successful. A negative number indicates a local failure (see VBA Return Values). A return value greater than zero indicates a failure on the server.
Declare Function EssVLoginSetPassword Lib "ESSEXCLN.XLL" (ByVal sheetName as Variant, ByVal newPassword As Variant, ByVal oldPassword As Variant, ByVal server As Variant, ByVal userName As Variant) As Long Sub SetPassword() Dim X As Long 'This sets the login password to password2 from password1 for the user User1 on server Local. X=EssVLoginSetPassword ("[Budget.xls]Sheet1", "password2", "password1", "Local", "User1") If X=0 then MsgBox("Set Password Successful.") Else MsgBox("Set Password Unsuccessful.") End If End Sub