Results 1 to 11 of 11
  1. #1
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,815
    Thanks
    132
    Thanked 480 Times in 457 Posts

    Screen display problem (xl2003)

    I have a large Excel file that contains many graphical elements (barcharts, buttons, text boxes etc).
    When another User opened the file, they couldn't see the bar charts or the buttons.
    We are both using Windows XP and Excel 2003.

    The only difference between us seem to be desktop screen resolution.
    (their laptop at 1024x768; me at 1280x1024)

    So I added a few lines of code to detect and set the zoom level for a couple of worksheets within the file.
    I saved the file, restarted and loaded the file - everythink OK.
    I then adjusted my desktop to 1024x768, loaded Excel and then the file and Excel immediately crashed.
    I quit everything without saving the (pathetic) 'recovered' file.
    I switched back to 1280x1024, loaded Excel, then the same file (that had just 'crashed') and everything worked and displayed as expected.

    So my question is - has anyone else come across such anomolous behaviour?
    I can't think of anything within Excel itself that could explain this.
    Is there anything within an Excel file that is somehow linked to desktop display resolution???

    zeddy

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Screen display problem (xl2003)

    Hi,
    From what you describe, it would seem very likely that the culprit is the code you added to check resolution - can you share it with us?
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Screen display problem (xl2003)

    Regards,
    Rudi

  4. #4
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,815
    Thanks
    132
    Thanked 480 Times in 457 Posts

    Re: Screen display problem (xl2003)

    Hi Rory

    I use..

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

    ..together with

    Sub getDesktopScreenResoultion()
    zWidth = GetSystemMetrics(0&) 'fetch desktop screen width e.g. 1024
    zHeight = GetSystemMetrics(1&) 'fetch desktop screen height e.g. 768
    [xPixelsCell] = zWidth 'save setting in prenamed cell
    [yPixelsCell] = zHeight 'save setting in prenamed cell
    End Sub

    I then use a lookup formula on a worksheet to return my required zoom settings
    to match the reported desktop resolution,

    =VLOOKUP(xPixelsCell,zoomBlock,3,TRUE)
    =VLOOKUP(xPixelsCell,zoomBlock,4,TRUE)

    where zommBlock is the named range for:
    vidX vidY zoom1 zoom2
    640 480 60 60
    800 600 60 60
    1024 768 80 80
    1152 864 110 100
    1280 1024 110 100

    For example,
    if the reported desktop width is 1024, then
    zoom1 value is 80%, zoom2 value is 80%

    if the reported desktop width is 1280, then
    zoom1 value is 110%, zoom2 value is 100%

    If I get a reported desktop width which isn't in
    my lookup table, I use a ISNA(..) formula to set a default to 100%

    My computed required zoom settings are saved on a worksheet
    in named cells [zoom1] and [zoom2]

    I use the following code segments to set my required zoom settings..

    ...
    fetchZoom1 = [zoom1]
    fetchZoom2 = [zoom2]

    Worksheets("ABC").Select 'switch to required sheet
    ActiveWindow.Zoom = fetchZoom1 'set required zoom level

    ...
    Worksheets("XYZ").Select 'switch to required sheet
    ActiveWindow.Zoom = zSetZoom2 'set required zoom level


    I have used similar methods in the past without any problems.


    zeddy

  5. #5
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,815
    Thanks
    132
    Thanked 480 Times in 457 Posts

    Re: Screen display problem (xl2003)

    Hi Rudi

    Thanks for the links.
    Useful info.
    Still can't explain why my buttons and charts become invisible.

    If I get to the bottom of it I will report back!

    Many thanks for everyones time and help

    zeddy

  6. #6
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,815
    Thanks
    132
    Thanked 480 Times in 457 Posts

    Re: Screen display problem (xl2003)

    sorry!

    That last bit should read

    Worksheets("XYZ").Select 'switch to required sheet
    ActiveWindow.Zoom = fetchZoom2 'set required zoom level


    zeddy

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Screen display problem (xl2003)

    I created a workbook with a simplified version of your code, and it works OK when I switch between 1280x1024, 1024x768 and 800x600 resolution. I have attached my workbook, what happens when you open it after switching resolutions?

    Perhaps you could attach a stripped down version of your workbook. You can remove all data except those needed for setting the zoom percentage.

  8. #8
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,815
    Thanks
    132
    Thanked 480 Times in 457 Posts

    Re: Screen display problem (xl2003)

    Hi Hans

    I switched by desktop display between 1280x1024, 1024x768 and 800x600 resolution.
    Each time I loaded your file, it reported the current desktop resolution and the correct corresponding zoom settings.
    This is the expected behaviour.

    My original problem relates to the actual disappearance of 'objects' - bar charts and 'button' images when viewed by different Excel users on different machines using the same Excel file.
    The zoom scaling of the Excel file to correspond to the desktop resolution was a quick attempt to fix the cosmetic appearance of startup screens and data worksheets.
    But the main issue remains as to why images are 'invisible' for some Users but not others.

    Curiously, one User has a setup with two displays attached.
    He is able to 'grab a window' and, using the mouse, scroll the window left until it appears half in one monitor and overlapping the other half in the second monitor.
    The 'split' view of this Excel file shows bar charts etc in one of the displays but not in the other!
    So I am believing it must be a display configuration issue rather than an Excel issue itself.
    I do not know of anything within Excel itself that can control this.

    zeddy

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Screen display problem (xl2003)

    I thought your primary problem was that the code crashed Excel after switching resolution.

    I can't reproduce the problem - objects are displayed at every zoom percentage and resolution. Perhaps there is a problem with the video card/drivers. Sometimes it helps to reduce or turn off hardware acceleration:
    - Open the Display Properties control panel.
    - Activate the Settings tab.
    - Click Advanced.
    - Activate the Troubleshoot tab.
    - Drag the hardware acceleration slider one or two notches to the left.
    - OK your way out.
    - If the problem disappears, fine. If it doesn't, you can restore the original setting.

  10. #10
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,815
    Thanks
    132
    Thanked 480 Times in 457 Posts

    Re: Screen display problem (xl2003)

    The main problem was the 'invisible' objects.
    My 'fix' to try and reset zoom scaling appeared to introduce another problem with the crash.
    Because it didn't crash when I reloaded the same file with a return to a hi-res desktop setting, I felt I was back to square 1, i.e. is there something within the combination of Excel and desktop resolution that could cause objects to become 'invisible'.
    I cannot replicate the 'invisible' objects problem on my machines.

    I will call the User tomorrow regarding the hardware acceleration.
    This sounds a promising line of attack.

    Many thanks for your help!

    zeddy

  11. #11
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Screen display problem (xl2003)

    Based on the difference between your and Hans' systems, I would suggest that you look on your display adapter vendor's web site to see if there is a more recent driver than the one you have installed. This also might resolve the problem with the disappearing objects.
    Legare Coleman

Posting Permissions

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