Option ExplicitPrivate Function MACAddress() As String
Dim objs As Object
Dim obj   Set objs = GetObject("winmgmts:").ExecQuery( _
      "SELECT MACAddress " & _
      "FROM Win32_NetworkAdapter " & _
      "WHERE " & _
      "((MACAddress Is Not NULL) " & _
      "AND (Manufacturer <> " & _
      "‘Microsoft‘))")
   For Each obj In objs
       '实时错误 -2147217385(80041017)
       '自动化错误
       '上面这行报的错误
       MsgBox obj.MACAddress
   Next obj
End Function
Private Sub Command1_Click()
Call MACAddress
End Sub'生成EXE后运行时出错
'运行时错误
'automation 操作期间未找到文件名或类名
'这是什么意思呀