Assigning IInterface* to TScriptInterface in c++

If I have a property of the form:

UPROPERTY(Replicated)
TScriptInterface Property;

where IInterface is an interface I have created in C++, and I have an AActor *MyActor, I can determine that this actor implements my interface by:

IInterface *MyInterface = Cast(MyActor);
if (MyInterface != nullptr)
{
// MyActor implements IInterface
}

However, If I then want to assign MyInterface to SomeObject.Property, I get the error:

void FScriptInterface::SetObject(UObject *)’: cannot convert argument 1 from ‘IInterface *’ to 'UObject *

How can I store a reference to this interface for later use?

Basically, you want to do this

if (MyActor->GetClass()->ImplementsInterface(UInterface::StaticClass())
{
    Property.SetInterface(Cast<IInterface>(MyActor));
    Property.SetObject(MyActor);
}

You can then use later as

if (Property != nullptr)
{
    Property->Execute_MyInterfaceMethod(MyActor);
}