@mehdibaghaee There are solid reasons why CodeGeneration is intended to work on multiple expressions in the context of a procedure. The effects of previous statements, and the type information that can be gleaned on a pass through a procedure, can be useful or necessary information for successful code translation.
For that reason alone I don't think that you're going to see much success even if you were to export the worksheet to plaintext (.mpl) format and try and apply CodeGeneration to top-level statements individually. (I'd also expect wrapping such an export in one big proc()...end proc to not fare well, even as a hail-Mary throw.)
If you have a worksheet with 3000 top-level statements then you already have growing problems with program flow-control. (I support that claim partially with the fact that you've also asked recently how to auto-execute whole worksheets without auto-expansion of subsections. And there are hints that your approach to programming with Maple is lacking useful structure.)
Furthermore, I hope you realize that only a specific subset of Maple command calls can be translated. Mostly those relate to low-level operations (usually within a purely numeric context). I've see some LinearAlgebra references in your previous questions, so it may be worth noting that calls to commands even in that package are not generally supported for translation to Matlab. (I have long wanted to add a so-called extension to CodeGeneration which did that, but there are difficulties even with basic things like the handling of 'Matrix' type-checks.) Even a call to the Matrix constructor using dimensions n, where n is previously assigned, can be problematic.
Have you considered placing key computational portions of your code into procedures? There are other benefits for doing so, apart from just code translation.