用來查詢Registry的值。
參考自MSDN
Sub Initialize
Dim oReg As Variant
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\DataAccess"
strValueName = "FullInstallVer"
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
Msgbox "Version: " & dwValue
End Sub