VBA to maximize the Application Window

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top