How to reactivate inactive gameObjects

I have a “Canvas” gameObject that contains my button. When the player presses the “E” Key, I want them to be able to deactivate and reactivate the menu (button). However, I can’t seem to deactivate it from another script. For example: This script is attatched to the FPS Controller. I can’t find a way to deactivate and reactivate the CanvasObject from another gameObject’s script. I have tried almost everything, and I’ve been googling for an hour. What am I doing wrong?

#pragma strict
var Money = 100;
public var GlassPrefab : Transform;
var Rotation;
var ShowBuildMenu = false;
var CanvasObject : Transform;
function Start () {

}

function Update () {
if(Input.GetKeyDown(KeyCode.E)){
ShowBuildMenu = !ShowBuildMenu;
//CanvasObject.gameObject.active = !CanvasObject.gameObject.active;
CanvasObject.enabled = ShowBuildMenu;
}
}

Thank you @bodec, that worked for me! I just had to grab a variable with that GameObject contained in it, and it seems to have worked!