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 excel.app

excelapp.WindowState = screenSize.Maximize()

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

Thanks.

hi @yigit.aybey,

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

Kind regards,
Kenneth

Hi,

ss

No Argument

15th line giving the error !!!

thx.

Hi @yigit.aybey ,

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

Microsoft.Office.Interop.Excel.XlWindowState.xlMaximized

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.