ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to get screen size ? (https://www.excelbanter.com/excel-programming/284773-how-get-screen-size.html)

Leo Luk

How to get screen size ?
 
Do any one know how to obtain the screen size property via
VBA ? (For example 1280 by 1024, 1024 by 768 ...)

I have developed an application at home but it look aweful
when I try to run it at work because it was based on the
screen size used at home.

Help

Taras

How to get screen size ?
 
Declare Function GetSystemMetrics Lib "user32" (ByVal
nIndex As Long) As Long

sub test()
msgbox prompt:= GetSystemMetrics(0) & "x" &
GetSystemMetrics(1)
end

The above worked for me
-----Original Message-----
Do any one know how to obtain the screen size property

via
VBA ? (For example 1280 by 1024, 1024 by 768 ...)

I have developed an application at home but it look

aweful
when I try to run it at work because it was based on the
screen size used at home.

Help
.


Leo Luk[_2_]

How to get screen size ?
 
Thanks for your response and appreciate your help. I copy
the code and try but keep geting 0x0 (I must have done
something incorrectly). I did try the one suggested by
Tom Ogilvy and is working.

Thanks and Merry Christmas

Leo

-----Original Message-----
Declare Function GetSystemMetrics Lib "user32" (ByVal
nIndex As Long) As Long

sub test()
msgbox prompt:= GetSystemMetrics(0) & "x" &
GetSystemMetrics(1)
end

The above worked for me
-----Original Message-----
Do any one know how to obtain the screen size property

via
VBA ? (For example 1280 by 1024, 1024 by 768 ...)

I have developed an application at home but it look

aweful
when I try to run it at work because it was based on the
screen size used at home.

Help
.

.


Tom Ogilvy

How to get screen size ?
 
It is pretty much the same as the third piece of code i gave you:

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

Sub test()
MsgBox prompt:=GetSystemMetrics(0) _
& "x" & GetSystemMetrics(1)
End Sub

Worked for me. Probably a word wrap problem.

--
Regards,
Tom Ogilvy

"Leo Luk" wrote in message
...
Thanks for your response and appreciate your help. I copy
the code and try but keep geting 0x0 (I must have done
something incorrectly). I did try the one suggested by
Tom Ogilvy and is working.

Thanks and Merry Christmas

Leo

-----Original Message-----
Declare Function GetSystemMetrics Lib "user32" (ByVal
nIndex As Long) As Long

sub test()
msgbox prompt:= GetSystemMetrics(0) & "x" &
GetSystemMetrics(1)
end

The above worked for me
-----Original Message-----
Do any one know how to obtain the screen size property

via
VBA ? (For example 1280 by 1024, 1024 by 768 ...)

I have developed an application at home but it look

aweful
when I try to run it at work because it was based on the
screen size used at home.

Help
.

.





All times are GMT +1. The time now is 04:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com