Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default Window Position & Size

Is there a way in Excel 2000 that when I open a file that it will
resize and position the excel application in the top 1/2 of the screen
? then I can have my browser in the lower 1/2 of the screen where I get
my data from.

Thanks,
Chris

  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

How about something like:

Option Explicit
Private Declare Function GetSystemMetrics Lib "user32" _
(ByVal nIndex As Long) As Long

Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1
Sub auto_open()
Dim myWidth As Long
Dim myHeight As Long

'with tools|references|microsoft internet controls unchecked
Dim MSIEApp As Object
Set MSIEApp = CreateObject("InternetExplorer.Application")

'with tools|references|microsoft internet controls checked
'Dim MSIEApp As InternetExplorer
'Set MSIEApp = New InternetExplorer

With Application
.WindowState = xlMaximized
myWidth = .Width
myHeight = .Height
.WindowState = xlNormal
.Left = 0
.Width = myWidth
.Top = myHeight / 2
.Height = myHeight / 2
End With


With MSIEApp.Application
.Visible = True
.Top = 0
.Left = 0
.Height = GetSystemMetrics(SM_CYSCREEN) / 2
.Width = GetSystemMetrics(SM_CXSCREEN)
End With
End Sub


If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm



wrote:

Is there a way in Excel 2000 that when I open a file that it will
resize and position the excel application in the top 1/2 of the screen
? then I can have my browser in the lower 1/2 of the screen where I get
my data from.

Thanks,
Chris


--

Dave Peterson
  #3   Report Post  
 
Posts: n/a
Default

That works :) Is there a way to have the excel sheet stay at the top of
the screen instead of resizing at the bottom.

Thanks for your help,
Chris

  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

Oops. I forgot the original question when I was setting it up.

Option Explicit
Private Declare Function GetSystemMetrics Lib "user32" _
(ByVal nIndex As Long) As Long
Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1
Sub auto_open()
Dim myWidth As Long
Dim myHeight As Long

'with tools|references|microsoft internet controls unchecked
Dim MSIEApp As Object
Set MSIEApp = CreateObject("InternetExplorer.Application")

'with tools|references|microsoft internet controls checked
'Dim MSIEApp As InternetExplorer
'Set MSIEApp = New InternetExplorer

With Application
.WindowState = xlMaximized
myWidth = .Width
myHeight = .Height
.WindowState = xlNormal
.Left = 0
.Width = myWidth
.Top = 0
.Height = myHeight / 2
End With

With MSIEApp.Application
.Visible = True
.Height = GetSystemMetrics(SM_CYSCREEN) / 2
.Width = GetSystemMetrics(SM_CXSCREEN)
.Top = .Height
.Left = 0
End With
End Sub



wrote:

That works :) Is there a way to have the excel sheet stay at the top of
the screen instead of resizing at the bottom.

Thanks for your help,
Chris


--

Dave Peterson
  #5   Report Post  
 
Posts: n/a
Default

Thanks for your help,
Chris

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ho to change in the bubble chart the bubble position and size laszlo Charts and Charting in Excel 0 March 25th 05 04:45 PM
Comment window size Eddie Excel Discussion (Misc queries) 1 March 24th 05 06:11 PM
I can't adjust the window size of an active workbook. Julie Excel Discussion (Misc queries) 1 January 26th 05 05:19 PM
Alternative window size? Hans Näslund Excel Discussion (Misc queries) 1 January 17th 05 11:13 PM
Alternative window size? Hans Näslund Excel Worksheet Functions 0 January 17th 05 02:26 PM


All times are GMT +1. The time now is 10:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"