Reduce excel to small size on screen at startup - How

  • Thread starter Thread starter Kennyatwork
  • Start date Start date
K

Kennyatwork

Hello

When I start Excel it is always maximized filling the screen, however I
would like to start one particular file in reduced size. I would like to do
this to hide it behind a userform. The idea is everything is carried out on
the userform then on exit the application closes without the user ever
seeing the sheet!
Could someone give me a clue on how to acheive this?

TIA

Kenny
 
Morning Kenny,

Put this code in the workbook Thisworkbook code module

Public myWIndow As Window

Private Sub Workbook_Open()
Set myWIndow = ActiveWindow
ActiveWindow.Visible = False
UserForm1.Show
End Sub


If yhou want the sheet to re-appear when the form is closed, add it to the
terminate event


Private Sub UserForm_Terminate()
ThisWorkbook.myWIndow.Visible = True
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Use
Userform1.show
Application.visible = False

to off Excel totally after loading Userform.

Use Application.quit after unloading userform.

Prasad Josh
 
Thanks Bob

I tried this but it does not acheive what I want.

Your code hides the sheet totally but leaves the excel application (toolbars
etc) full screen.
I am trying to acheive the same as clicking on the middle box in the top
right of the screen (between the minimized button and the close button)
Can you help?

Kenny
 
Morning again Kenny,

User! Who needs 'em <vbg>

Try this version


Public myWIndow As Window

Private Sub Workbook_Open()
Set myWIndow = ActiveWindow
ActiveWindow.Visible = False
Application.WindowState = xlMinimized
UserForm1.Show
End Sub


and userform

Private Sub UserForm_Terminate()
Application.WindowState = xlNormal
ThisWorkbook.myWIndow.Visible = True
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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

Back
Top