Maximizing Excel via Using VB.Net

Hi all,

i need to maximize the excel window. I declared screensize as a window and i assigned the windowstate = screensize.maximize but i got an error. How can i manage or how can i maximize the window.
I defined excelapp as an

excelapp.WindowState = screenSize.Maximize()

The error is ‘Expression does not produce a value’
All codes are in the invoke code.


hi @yigit.aybey,

Would it be possible if you can share the screenshot of the invoke code and its property? Thanks.

Kind regards,



No Argument

15th line giving the error !!!


Hi @yigit.aybey ,

Could you try replacing the screenSize.Maximize() with the below :


Let us know if you still get an error.

1 Like

It worked.

Thank you. :slight_smile:

1 Like

here’s my code:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.