Help, in modifying VBA to maximize my active window using button.

lbillie

New Member
Joined
Jun 21, 2013
Messages
28
I click on my button to open a file then it minimizes the file, I would also like the active screen I was currently working on to maximize instead of partially showing up in my window. This is the macros I'm currently using. Need help in modifying it the VBA to maximize the active workbook. Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Workbooks.Open "P:\Procedures\Product Outlines\DRIVE\DRIVE_LINKS\DRIVE_PICS.xls"
ActiveWindow.WindowState = xlMinimized
Application.ScreenUpdating = True

End Sub
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
I tried that, it maximized the file I wanted to minimize. I would like to maximize the file with the macro button. It retrieves the pictures from the minimized file. While clicking on some checkbox selection, pictures would auto populate. I tried this too: Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Workbooks.Open "P:\Procedures\Product Outlines\DRIVE\DRIVE_LINKS\DRIVE_PICS.xls"
ActiveWindow.WindowState = xlMinimized
Application.ScreenUpdating = xlMaximized

End Sub
 
Upvote 0
Does this not work for you?

Code:
Private Sub CommandButton1_Click()
    Application.ScreenUpdating = False
    Workbooks.Open Filename:="P:\Procedures\Product Outlines\DRIVE\DRIVE_LINKS\DRIVE_PICS.xls"
    ActiveWindow.WindowState = xlMinimized
    ActiveWindow.WindowState = xlMaximized
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,759
Messages
6,132,549
Members
449,735
Latest member
Gary_M

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top