"Prefab GameObject's cannot be made active!"

I get this error: “Prefab GameObject’s cannot be made active!”
How do I solve this frustrating problem ? I’ve checked other answers but none relate to mine, because the object I’m trying to activate is in the hierarchy view, and is referenced by a script in another object.
It seems I cannot deactivate and reactivate the object repeatedly. If so, what alternative can be used ? Can I change state of one of the object’s properties instead ?

I have tried setting the object’s ‘x’ position parameter with GameObject.transform.position.x instead and it worked. So I could just set the object’s ‘x’ position between ‘1’ and ‘0’ to represent true or false, instead of switching between active and inactive.