The story begins just after the conclusion of Charlie and the Chocolate Factory. In Chocolate Factory, Wonka and Charlie are in a giant glass elevator, rocketing through the sky. Wonka has just offered his factory to Charlie. They decide to go to Charlie’s home, to tell his family the news. They crash straight through the roof of Charlie’s house, shocking his parents and grandparents. Wonka explains the situation and asks the family to come with him. The grandparents, except for Grandpa Joe, refuse to get out of their bed, and Wonka is left with no choice but to take the entire bed with him.
Now in the Great Glass Elevator, Wonka explains that they must go up before they can go down, meaning they need to gather enough momentum to crash through the roof of the factory. At the last moment, Grandma Josephine has a panic attack and draws Wonka away from the controls. This causes the Elevator to gain too much speed and rocket into orbit, stranding the entire group in outer space.
The Elevator circles the Earth until Wonka decides to link it up to the Space Hotel, a new attraction commissioned by the United States government. They will be the first humans to set foot in the completed building.
Back on Earth, members of the United States government watch as the Elevator docks with the hotel, and they worry that it contains terrorists or aliens. They address Wonka by radio, and Wonka confuses them by spouting nonsense words. The U.S. now believes Wonka to be an alien from Mars, and invites him to the White House.
While this is happening, the hotel elevators open and five large, terrifying alien creatures rearrange themselves to spell the word SCRAM. Wonka panics and orders everyone back into the Glass Elevator. He shoots them away from the Hotel as fast as possible; he explains that the monsters are Vermicious Knids and want to consume all of the humans they can. They have tried to destroy Earth before, but they can’t get past the atmosphere.
After Wonka’s group leaves, a group of workers for the Hotel arrives in the Commuter Capsule. The Knids eat many of them, but some--including the three famous astronauts, Shuckworth, Shanks, and Showler--escape.
The Knids follow the Capsule into space and begin to dive-bomb it. One Knid had tried to do the same to the Elevator, but the Elevator is thankfully Knid-proof. Charlie suggests that Wonka save them. Wonka drives the Elevator closer to the shuttle, and Grandpa Joe connects the two with a steel cord. The Knids attach themselves to the ship. Wonka drops the Elevator back to Earth, which saves the humans but destroys all the Knids. The Elevator then returns to the Chocolate Factory.
Throughout all of this, George, Georgina, and Josephine have still refused to get out of their beds, believing that they are too old. Wonka prescribes Wonka-Vite, a potion that will make them younger. However, they take too much: George and Josephine turn into babies, and Georgina becomes -2. Wonka and Charlie go to Minusland, which is filled with people who are a negative age. They spray her with Vita-Wonk to reverse the first pills, making her 358 years old.
Then, with a carefully calculated dose of Wonka-Vite, they restore her to her original age, along with George and Josephine.
The Oompa-Loompas present Wonka with an invitation from the President to the White House as a thanks for saving the shuttle. They are invited to a very important dinner. After receiving this news, all of Charlie's family jumps out of bed and enters the helicopter that will take them to the White House.