Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
Thanks for your help,
Chris |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ho to change in the bubble chart the bubble position and size | Charts and Charting in Excel | |||
Comment window size | Excel Discussion (Misc queries) | |||
I can't adjust the window size of an active workbook. | Excel Discussion (Misc queries) | |||
Alternative window size? | Excel Discussion (Misc queries) | |||
Alternative window size? | Excel Worksheet Functions |