获取CPU数量:
Private Type SYSTEM_INFO
    dwOemID                  As Long
    dwPageSize               As Long
    lpMinimumApplicationAddress As Long
    lpMaximumApplicationAddress As Long
    dwActiveProcessorMask    As Long
    dwNumberOrfProcessors    As Long
    dwProcessorType          As Long
    dwAllocationGranularity  As Long
    dwReserved               As Long
End Type

Private Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)

Dim SysInfo As SYSTEM_INFO
GetSystemInfo SysInfo
MsgBox SysInfo.dwNumberOrfProcessors