dcsimg
Results 1 to 4 of 4

Thread: Getting Screen Resolution in VBA???

Hybrid View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    72

    Question

    Hi all,

    ok well I looked online on the MSDN web site for some info on finding out how you could get screen resolution. I found some code examples for it, but they are super shoal. Here is what I found:

    Code:
    horz = System.HorizontalResolution
    vert = System.VerticalResolution
    MsgBox "Resolution = " & horz & " x " & vert
    *EDIT* I found out that this System object applies to FrontPage only.. I am using Excel.

    Unfortuately the System object can't be used in this manner, since it is not identified. I looked up the alleged heirarcy and MSDN told me that the Application object has a System object in it... but this is not true. I have autocomplete on my VB writer and there is no System object within the Application object.


    Any idea's on how I can accomplish this?

    Thanx in advance,
    cLocKwOrk


    [Edited by cLocKwOrk on 12-15-2000 at 03:25 PM]

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    Try this:
    Code:
    Dim ResWidth As Integer 
    Dim ResHeight As Integer 
    Dim screenRes As String 
    
    ResWidth = Screen.Width / Screen.TwipsPerPixelX 
    ResHeight = Screen.Height / Screen.TwipsPerPixelY 
    ScreenRes = ResWidth & "x" & ResHeight
    Oetje
    oetje@home.nl
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    72
    The Screen object is not defined either. I am using Excel. That might have some bearing on what fucntions I can use.

    -cLocKwOrk

  4. #4
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    Maybe you can use the api functions.
    http://www.vb-world.net/demos/getscreenres/
    Oetje
    oetje@home.nl
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width