📊 VBA (Excel)
Check Enable Dark Mode Registry Value (VBA)
Reads the Enable Dark Mode registry value via WScript.Shell.RegRead and reports it in a message box — no PowerShell or reg.exe needed.
DarkModeRegCheck.bas
Attribute VB_Name = "DarkModeRegCheck"
Option Explicit
Public Sub DarkModeRegCheck()
Dim wsh As Object
Dim regPath As String
Dim value As Variant
Set wsh = CreateObject("WScript.Shell")
regPath = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize\AppsUseLightTheme"
On Error Resume Next
value = wsh.RegRead(regPath)
On Error GoTo 0
If IsEmpty(value) Then
MsgBox "Value not set:" & vbCrLf & regPath, vbExclamation, "Enable Dark Mode"
Else
MsgBox "Enable Dark Mode" & vbCrLf & regPath & " = " & value, vbInformation
End If
End Sub