used to not work for me either, but strangely, when I maximized the screen where you edit the map, I could generate the code...
But me advised, generating code will only place the objects on the map. If you want an AI, disasters, victory conditions, triggers, you'll need to code them yourself, as they are not included in the mappers code generation.