This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using LogInAsUser Method

Hello !

I'm trying to allow an excel document to have admin autorisations so the document can do things the user can't.

In order to do that, I'm trying to connect to my M-Files vault with an admin account when I open the document (as i would with the current user session) :

I define a MFiles Client Application Object :

Dim oClientApp As Object
Set oClientApp = CreateObject("MFilesAPI.MFilesClientApplication")

Then I define my vault connection :

Dim oVaultConnection As Object
Set oVaultConnection = CreateObject("MFilesAPI.VaultConnection")
Set oVaultConnection = oClientApp.GetVaultConnection("Myvault")

And finally, I log in with the correct credentials :

Dim oVault As Object
Set oVault = CreateObject("MFilesAPI.Vault")
Set oVault = oVaultConnection.LogInAsUser(MFAuthTypeSpecificMFilesUser, "Username", "Password")

With Username and Password being the actual username and the actual password.

However, when I run the code, I get the following error :

"Automation error
Indicator proposed incorrect"

I've been trying every possible method and parameters for days and I'm out of options.

Does anyone have a clue on what to do ? The API isn't really helping...