1
votes

I have complex Excel workbook with macros. I have a number of clients that use the workbook in different hardware environments (all on PCs running Excel 2010+). I have found disabling hardware acceleration in Excel 2013+ and turning off animations in the Windows environment vastly improves the user experience and all but fixes the dreaded Excel white "not responding" screens or force closing. Why the display adapter and animations cause issues in Excel while working on a Windows PC is beyond me and besides the point. No matter how many emails or reminders I send to my clients to check the "Disable hardware acceleration" box in Excel options or to disable animations in their windows settings, they inevitably don't do it and then complain when Excel acts up. I'm looking for a way to test these settings. I looked through the Excel application library and didn't see anything promising and wonder if it's even possible to find these settings using VBA.

I've reviewed these articles:

Windows: Programatically determine if hardware acceleration can be disabled

Detecting Windows animation settings -Showed some promise but not sure if I can do this using VBA

Specifically, these are the settings I'm trying to test (being able to change them programmatically would be a huge bonus, but right now, I just want to test for their current value):

Excel Options: Advanced: Disable hardware graphics acceleration:

Excel Option to Disable hardware graphics acceleration

Windows 10 Ease of Use Display setting: Show animation in Windows Window 10 Ease of use display settings

Windows 10 Control Panel: System Performance Options: Animate controls and elements inside window Windows 10 Control Panel System Performance Options: Animate controls and elements inside window

Thanks in advance!

2

2 Answers

1
votes

It looks like a registry setting Graphics Rendering Registry Settings

Do you know how to write to the registry? Should be examples on here, StackOverflow.

You might want to save off your registry to a textfile, change the setting, save the registry a second time and compare the two to give you the delta, i.e. what changed.

Actually this might help, Display issues in Office client applications Says there you make it a Group Policy These are managed thus

Elsewhere on StackOverflow others are changing group policy via the command line so you could write VBA to shell to the command line.

1
votes

I used S Meaden's suggestion; exported the registry as a text file, made the change in Excel Options, exported the registry again and used WinMerge to compare the two. Found this key changed from 0 to 1 for Excel 2013+ (slightly differs for Excel 2010, didn't check 2007):

HKEY_CURRENT_USER\Software\Microsoft\Office\ (YourOfficeVersionNumber)\Common\Graphics\DisableHardwareAcceleration

I use this Excel VBA function to test if hardware acceleration has been disabled in Excel Settings:

Function HardwareAccelerationDisabled() As String
    'Returns T if setting is disabled, F not disabled, or X if couldn't access the registry key
    On Error GoTo HardwareAccelerationDisabled_Error
    If Application.Version = 14# Then 'For Excel 2010
        HardwareAccelerationDisabled = Left(1 = CreateObject("WScript.Shell").RegRead("HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Gfx\DisableHardware"), 1)
    Else 'For Excel 2013+
        HardwareAccelerationDisabled = Left(1 = CreateObject("WScript.Shell").RegRead("HKEY_CURRENT_USER\Software\Microsoft\Office\" & Application.Version & "\Common\Graphics\DisableHardwareAcceleration"), 1)
    End If
    On Error GoTo 0
    Exit Function

HardwareAccelerationDisabled_Error:
    HardwareAccelerationDisabled = "X"    
End Function

Still need to look at the animation settings, but this hardware acceleration was my biggest issue.