It is possible.
If you believe citation needed Trivia on IMDB
According to the producers, the decision to make Robert California the new boss wasn't made before this episode, but after being impressed with what James Spader brought to the character in one single scene.
Which means they saw his cameo and made a decision to make him the new boss.
At the same time, you have this interview by TV Guide with writers and cast about Steve Carell's exit. Here are some exerts from those interviews.
Greg Daniels: Early on, everybody renegotiated and they added a year to their contracts, but Steve didn't. So everybody's contracts went through Season 8 except for Steve. So we knew very early on that he was going to leave at the end of Season 7. (emphasis added).
The question turned to whether the documentary — and the show — could go on without its narrator and leading man.
Daniels: We felt like our bench was so deep with the cast that we could tell plenty of stories, and great stories, with the people that we had. We felt like the show had a lot of juice left.
Silverman: I knew the show could go on, no doubt. We had a murderer's row. Mickey Mantle replaced Joe DiMaggio and, in terms of taking Steve's mantle, Ed Helms and then Rainn Wilson and all of our characters did that.
From this it sounds like they fully expected the ensemble cast to be able to continue without another heavy hitter comedian, like many of the cameos in "Search Committee."