大众计算机学习网

专门提供各种电脑教程

vba如何得到显卡的信息

Admin | 2010-10-20 11:17:23 | 被阅次数 | 4825

  如下的VBA代码,用于获取本机显卡的相关信息:

  On Error Resume Next
  Dim tmp1, tmp2
  Set tmp2 = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_VideoController")
  For Each tmp1 In tmp2
  MsgBox "型 号: " & tmp1.VideoProcessor & vbCrLf & "厂 商: " & tmp1.AdapterCompatibility & vbCrLf & "名 称: " & tmp1.Name & vbCrLf & "状 态: " & tmp1.Status & vbCrLf & "显 存: " & (tmp1.AdapterRAM \ 1024000) & "MB" & vbCrLf & "驱 动(dll): " & tmp1.InstalledDisplayDrivers & vbCrLf & "驱 动(inf): " & tmp1.infFilename & vbCrLf & "版 本: " & tmp1.DriverVersion
  Next