View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Harold Druss Harold Druss is offline
external usenet poster
 
Posts: 2
Default Center application window

Hi
Trying to center the Excel application.
Screen resalution is 1280 x 1024
newWidth is a long and set to 800
newHeight is a long and set to 600
maxWidth is a long and set to 1280
maxHeight is a long and set to 1024

The following code moves the to far left and to far from the top.

Application.WindowState = xlNormal
Application.Width = newWidth
Application.Height = newHeight
Application.Left = (maxWidth - newWidth) / 2
Application.Top = (maxHeight - newHeight) / 2

Thanks
Harold