VBA to maximize the Application Window

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Sorry for the cross post, I also posted this in the Excel forum, but on
second thought, it may be better answered here...

I am using MS-Excel to automate MS-Access and all is well except, I need to
know how to make the application (Access) run maximized; that is, maximize
the Application window. My code so far:

Dim oAccessApp as Object
Set oAccessApp = GetObject(csFullNameDestin, "Access.Application")
oAccessApp.Visible = True
oAccessApp.<Need code here to maximize the APPLICATION>

I tried using "oAccessApp.DoCmd.Maximize" but this only maximizes the user
form.

Can someone please correct my code or post the command(s) I need to maximize
the Application?

Thanks.
 
In the visual basic editor, click on the + beside VBAProject (this will be
the name of your workbook), click the + beside Microsoft Excel Objects and
then right click on ThisWorkbook and click view code.

if the Sub Workbook_open() is there add

Application.WindowState = wdWindowStateMaximize

if the sub isn't there you should create it with the above line in it.
 
Back
Top