Bonjour à toutes et à tous,
Est-il possible, en VBA Excel, de trouver le N° de série de la carte mère
du
PC (ou du PC lui-même s'il en a un) ?
Merci d'avance
--
claudius
Bonjour à toutes et à tous,
Est-il possible, en VBA Excel, de trouver le N° de série de la carte mère
du
PC (ou du PC lui-même s'il en a un) ?
Merci d'avance
--
claudius
Bonjour à toutes et à tous,
Est-il possible, en VBA Excel, de trouver le N° de série de la carte mère
du
PC (ou du PC lui-même s'il en a un) ?
Merci d'avance
--
claudius
Bonjour claudius;
Si tu as XP:
1 - Carte mère
Sub Win32_BaseBoard()
On Error Resume Next
Const strComputer$ = "."
Dim i%, objWMIService As Object, colItems As Object, objItem As Object
Set objWMIService = GetObject("winmgmts:" & strComputer & "rootcimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard", ,
48)
For Each objItem In colItems
i = i + 1: Cells(i, 1) = "Caption: " & objItem.Caption
i = i + 1: Cells(i, 1) = "ConfigOptions: " & objItem.ConfigOptions
i = i + 1: Cells(i, 1) = "CreationClassName: " & objItem.CreationClassName
i = i + 1: Cells(i, 1) = "Depth: " & objItem.Depth
i = i + 1: Cells(i, 1) = "Description: " & objItem.Description
i = i + 1: Cells(i, 1) = "Height: " & objItem.Height
i = i + 1: Cells(i, 1) = "HostingBoard: " & objItem.HostingBoard
i = i + 1: Cells(i, 1) = "HotSwappable: " & objItem.HotSwappable
i = i + 1: Cells(i, 1) = "InstallDate: " & objItem.InstallDate
i = i + 1: Cells(i, 1) = "Manufacturer: " & objItem.Manufacturer
i = i + 1: Cells(i, 1) = "Model: " & objItem.Model
i = i + 1: Cells(i, 1) = "Name: " & objItem.Name
i = i + 1: Cells(i, 1) = "OtherIdentifyingInfo: " &
objItem.OtherIdentifyingInfo
i = i + 1: Cells(i, 1) = "PartNumber: " & objItem.PartNumber
i = i + 1: Cells(i, 1) = "PoweredOn: " & objItem.PoweredOn
i = i + 1: Cells(i, 1) = "Product: " & objItem.Product
i = i + 1: Cells(i, 1) = "Removable: " & objItem.Removable
i = i + 1: Cells(i, 1) = "Replaceable: " & objItem.Replaceable
i = i + 1: Cells(i, 1) = "RequirementsDescription: " &
objItem.RequirementsDescription
i = i + 1: Cells(i, 1) = "RequiresDaughterBoard: " &
objItem.RequiresDaughterBoard
i = i + 1: Cells(i, 1) = "SerialNumber: " & objItem.SerialNumber
i = i + 1: Cells(i, 1) = "SKU: " & objItem.SKU
i = i + 1: Cells(i, 1) = "SlotLayout: " & objItem.SlotLayout
i = i + 1: Cells(i, 1) = "SpecialRequirements: " &
objItem.SpecialRequirements
i = i + 1: Cells(i, 1) = "Status: " & objItem.Status
i = i + 1: Cells(i, 1) = "Tag: " & objItem.Tag
i = i + 1: Cells(i, 1) = "Version: " & objItem.Version
i = i + 1: Cells(i, 1) = "Weight: " & objItem.Weight
i = i + 1: Cells(i, 1) = "Width: " & objItem.Width
Next
Set colItems = Nothing
Set objWMIService = Nothing
End Sub
2 - PC
Sub Win32_SystemEnclosure()
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & strComputer & "rootcimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_SystemEnclosure", , 48)
For Each objItem In colItems
i = i + 1: Cells(i, 1) = "AudibleAlarm: " & objItem.AudibleAlarm
i = i + 1: Cells(i, 1) = "BreachDescription: " & objItem.BreachDescription
i = i + 1: Cells(i, 1) = "CableManagementStrategy: " &
objItem.CableManagementStrategy
i = i + 1: Cells(i, 1) = "Caption: " & objItem.Caption
i = i + 1: Cells(i, 1) = "ChassisTypes: " & objItem.ChassisTypes
i = i + 1: Cells(i, 1) = "CreationClassName: " & objItem.CreationClassName
i = i + 1: Cells(i, 1) = "CurrentRequiredOrProduced: " &
objItem.CurrentRequiredOrProduced
i = i + 1: Cells(i, 1) = "Depth: " & objItem.Depth
i = i + 1: Cells(i, 1) = "Description: " & objItem.Description
i = i + 1: Cells(i, 1) = "HeatGeneration: " & objItem.HeatGeneration
i = i + 1: Cells(i, 1) = "Height: " & objItem.Height
i = i + 1: Cells(i, 1) = "HotSwappable: " & objItem.HotSwappable
i = i + 1: Cells(i, 1) = "InstallDate: " & objItem.InstallDate
i = i + 1: Cells(i, 1) = "LockPresent: " & objItem.LockPresent
i = i + 1: Cells(i, 1) = "Manufacturer: " & objItem.Manufacturer
i = i + 1: Cells(i, 1) = "Model: " & objItem.Model
i = i + 1: Cells(i, 1) = "Name: " & objItem.Name
i = i + 1: Cells(i, 1) = "NumberOfPowerCords: " & objItem.NumberOfPowerCords
i = i + 1: Cells(i, 1) = "OtherIdentifyingInfo: " &
objItem.OtherIdentifyingInfo
i = i + 1: Cells(i, 1) = "PartNumber: " & objItem.PartNumber
i = i + 1: Cells(i, 1) = "PoweredOn: " & objItem.PoweredOn
i = i + 1: Cells(i, 1) = "Removable: " & objItem.Removable
i = i + 1: Cells(i, 1) = "Replaceable: " & objItem.Replaceable
i = i + 1: Cells(i, 1) = "SecurityBreach: " & objItem.SecurityBreach
i = i + 1: Cells(i, 1) = "SecurityStatus: " & objItem.SecurityStatus
i = i + 1: Cells(i, 1) = "SerialNumber: " & objItem.SerialNumber
i = i + 1: Cells(i, 1) = "ServiceDescriptions: " &
objItem.ServiceDescriptions
i = i + 1: Cells(i, 1) = "ServicePhilosophy: " & objItem.ServicePhilosophy
i = i + 1: Cells(i, 1) = "SKU: " & objItem.SKU
i = i + 1: Cells(i, 1) = "SMBIOSAssetTag: " & objItem.SMBIOSAssetTag
i = i + 1: Cells(i, 1) = "Status: " & objItem.Status
i = i + 1: Cells(i, 1) = "Tag: " & objItem.Tag
i = i + 1: Cells(i, 1) = "TypeDescriptions: " & objItem.TypeDescriptions
i = i + 1: Cells(i, 1) = "Version: " & objItem.Version
i = i + 1: Cells(i, 1) = "VisibleAlarm: " & objItem.VisibleAlarm
i = i + 1: Cells(i, 1) = "Weight: " & objItem.Weight
i = i + 1: Cells(i, 1) = "Width: " & objItem.Width
Next
End Sub
MP
"claudius" a écrit dans le message de
news:Bonjour à toutes et à tous,
Est-il possible, en VBA Excel, de trouver le N° de série de la carte mère
duPC (ou du PC lui-même s'il en a un) ?
Merci d'avance
--
claudius
Bonjour claudius;
Si tu as XP:
1 - Carte mère
Sub Win32_BaseBoard()
On Error Resume Next
Const strComputer$ = "."
Dim i%, objWMIService As Object, colItems As Object, objItem As Object
Set objWMIService = GetObject("winmgmts:\" & strComputer & "rootcimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard", ,
48)
For Each objItem In colItems
i = i + 1: Cells(i, 1) = "Caption: " & objItem.Caption
i = i + 1: Cells(i, 1) = "ConfigOptions: " & objItem.ConfigOptions
i = i + 1: Cells(i, 1) = "CreationClassName: " & objItem.CreationClassName
i = i + 1: Cells(i, 1) = "Depth: " & objItem.Depth
i = i + 1: Cells(i, 1) = "Description: " & objItem.Description
i = i + 1: Cells(i, 1) = "Height: " & objItem.Height
i = i + 1: Cells(i, 1) = "HostingBoard: " & objItem.HostingBoard
i = i + 1: Cells(i, 1) = "HotSwappable: " & objItem.HotSwappable
i = i + 1: Cells(i, 1) = "InstallDate: " & objItem.InstallDate
i = i + 1: Cells(i, 1) = "Manufacturer: " & objItem.Manufacturer
i = i + 1: Cells(i, 1) = "Model: " & objItem.Model
i = i + 1: Cells(i, 1) = "Name: " & objItem.Name
i = i + 1: Cells(i, 1) = "OtherIdentifyingInfo: " &
objItem.OtherIdentifyingInfo
i = i + 1: Cells(i, 1) = "PartNumber: " & objItem.PartNumber
i = i + 1: Cells(i, 1) = "PoweredOn: " & objItem.PoweredOn
i = i + 1: Cells(i, 1) = "Product: " & objItem.Product
i = i + 1: Cells(i, 1) = "Removable: " & objItem.Removable
i = i + 1: Cells(i, 1) = "Replaceable: " & objItem.Replaceable
i = i + 1: Cells(i, 1) = "RequirementsDescription: " &
objItem.RequirementsDescription
i = i + 1: Cells(i, 1) = "RequiresDaughterBoard: " &
objItem.RequiresDaughterBoard
i = i + 1: Cells(i, 1) = "SerialNumber: " & objItem.SerialNumber
i = i + 1: Cells(i, 1) = "SKU: " & objItem.SKU
i = i + 1: Cells(i, 1) = "SlotLayout: " & objItem.SlotLayout
i = i + 1: Cells(i, 1) = "SpecialRequirements: " &
objItem.SpecialRequirements
i = i + 1: Cells(i, 1) = "Status: " & objItem.Status
i = i + 1: Cells(i, 1) = "Tag: " & objItem.Tag
i = i + 1: Cells(i, 1) = "Version: " & objItem.Version
i = i + 1: Cells(i, 1) = "Weight: " & objItem.Weight
i = i + 1: Cells(i, 1) = "Width: " & objItem.Width
Next
Set colItems = Nothing
Set objWMIService = Nothing
End Sub
2 - PC
Sub Win32_SystemEnclosure()
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\" & strComputer & "rootcimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_SystemEnclosure", , 48)
For Each objItem In colItems
i = i + 1: Cells(i, 1) = "AudibleAlarm: " & objItem.AudibleAlarm
i = i + 1: Cells(i, 1) = "BreachDescription: " & objItem.BreachDescription
i = i + 1: Cells(i, 1) = "CableManagementStrategy: " &
objItem.CableManagementStrategy
i = i + 1: Cells(i, 1) = "Caption: " & objItem.Caption
i = i + 1: Cells(i, 1) = "ChassisTypes: " & objItem.ChassisTypes
i = i + 1: Cells(i, 1) = "CreationClassName: " & objItem.CreationClassName
i = i + 1: Cells(i, 1) = "CurrentRequiredOrProduced: " &
objItem.CurrentRequiredOrProduced
i = i + 1: Cells(i, 1) = "Depth: " & objItem.Depth
i = i + 1: Cells(i, 1) = "Description: " & objItem.Description
i = i + 1: Cells(i, 1) = "HeatGeneration: " & objItem.HeatGeneration
i = i + 1: Cells(i, 1) = "Height: " & objItem.Height
i = i + 1: Cells(i, 1) = "HotSwappable: " & objItem.HotSwappable
i = i + 1: Cells(i, 1) = "InstallDate: " & objItem.InstallDate
i = i + 1: Cells(i, 1) = "LockPresent: " & objItem.LockPresent
i = i + 1: Cells(i, 1) = "Manufacturer: " & objItem.Manufacturer
i = i + 1: Cells(i, 1) = "Model: " & objItem.Model
i = i + 1: Cells(i, 1) = "Name: " & objItem.Name
i = i + 1: Cells(i, 1) = "NumberOfPowerCords: " & objItem.NumberOfPowerCords
i = i + 1: Cells(i, 1) = "OtherIdentifyingInfo: " &
objItem.OtherIdentifyingInfo
i = i + 1: Cells(i, 1) = "PartNumber: " & objItem.PartNumber
i = i + 1: Cells(i, 1) = "PoweredOn: " & objItem.PoweredOn
i = i + 1: Cells(i, 1) = "Removable: " & objItem.Removable
i = i + 1: Cells(i, 1) = "Replaceable: " & objItem.Replaceable
i = i + 1: Cells(i, 1) = "SecurityBreach: " & objItem.SecurityBreach
i = i + 1: Cells(i, 1) = "SecurityStatus: " & objItem.SecurityStatus
i = i + 1: Cells(i, 1) = "SerialNumber: " & objItem.SerialNumber
i = i + 1: Cells(i, 1) = "ServiceDescriptions: " &
objItem.ServiceDescriptions
i = i + 1: Cells(i, 1) = "ServicePhilosophy: " & objItem.ServicePhilosophy
i = i + 1: Cells(i, 1) = "SKU: " & objItem.SKU
i = i + 1: Cells(i, 1) = "SMBIOSAssetTag: " & objItem.SMBIOSAssetTag
i = i + 1: Cells(i, 1) = "Status: " & objItem.Status
i = i + 1: Cells(i, 1) = "Tag: " & objItem.Tag
i = i + 1: Cells(i, 1) = "TypeDescriptions: " & objItem.TypeDescriptions
i = i + 1: Cells(i, 1) = "Version: " & objItem.Version
i = i + 1: Cells(i, 1) = "VisibleAlarm: " & objItem.VisibleAlarm
i = i + 1: Cells(i, 1) = "Weight: " & objItem.Weight
i = i + 1: Cells(i, 1) = "Width: " & objItem.Width
Next
End Sub
MP
"claudius" <claudius@discussions.microsoft.com> a écrit dans le message de
news:39E6381A-F4D3-47A1-BE6B-DA622815AAFF@microsoft.com...
Bonjour à toutes et à tous,
Est-il possible, en VBA Excel, de trouver le N° de série de la carte mère
du
PC (ou du PC lui-même s'il en a un) ?
Merci d'avance
--
claudius
Bonjour claudius;
Si tu as XP:
1 - Carte mère
Sub Win32_BaseBoard()
On Error Resume Next
Const strComputer$ = "."
Dim i%, objWMIService As Object, colItems As Object, objItem As Object
Set objWMIService = GetObject("winmgmts:" & strComputer & "rootcimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard", ,
48)
For Each objItem In colItems
i = i + 1: Cells(i, 1) = "Caption: " & objItem.Caption
i = i + 1: Cells(i, 1) = "ConfigOptions: " & objItem.ConfigOptions
i = i + 1: Cells(i, 1) = "CreationClassName: " & objItem.CreationClassName
i = i + 1: Cells(i, 1) = "Depth: " & objItem.Depth
i = i + 1: Cells(i, 1) = "Description: " & objItem.Description
i = i + 1: Cells(i, 1) = "Height: " & objItem.Height
i = i + 1: Cells(i, 1) = "HostingBoard: " & objItem.HostingBoard
i = i + 1: Cells(i, 1) = "HotSwappable: " & objItem.HotSwappable
i = i + 1: Cells(i, 1) = "InstallDate: " & objItem.InstallDate
i = i + 1: Cells(i, 1) = "Manufacturer: " & objItem.Manufacturer
i = i + 1: Cells(i, 1) = "Model: " & objItem.Model
i = i + 1: Cells(i, 1) = "Name: " & objItem.Name
i = i + 1: Cells(i, 1) = "OtherIdentifyingInfo: " &
objItem.OtherIdentifyingInfo
i = i + 1: Cells(i, 1) = "PartNumber: " & objItem.PartNumber
i = i + 1: Cells(i, 1) = "PoweredOn: " & objItem.PoweredOn
i = i + 1: Cells(i, 1) = "Product: " & objItem.Product
i = i + 1: Cells(i, 1) = "Removable: " & objItem.Removable
i = i + 1: Cells(i, 1) = "Replaceable: " & objItem.Replaceable
i = i + 1: Cells(i, 1) = "RequirementsDescription: " &
objItem.RequirementsDescription
i = i + 1: Cells(i, 1) = "RequiresDaughterBoard: " &
objItem.RequiresDaughterBoard
i = i + 1: Cells(i, 1) = "SerialNumber: " & objItem.SerialNumber
i = i + 1: Cells(i, 1) = "SKU: " & objItem.SKU
i = i + 1: Cells(i, 1) = "SlotLayout: " & objItem.SlotLayout
i = i + 1: Cells(i, 1) = "SpecialRequirements: " &
objItem.SpecialRequirements
i = i + 1: Cells(i, 1) = "Status: " & objItem.Status
i = i + 1: Cells(i, 1) = "Tag: " & objItem.Tag
i = i + 1: Cells(i, 1) = "Version: " & objItem.Version
i = i + 1: Cells(i, 1) = "Weight: " & objItem.Weight
i = i + 1: Cells(i, 1) = "Width: " & objItem.Width
Next
Set colItems = Nothing
Set objWMIService = Nothing
End Sub
2 - PC
Sub Win32_SystemEnclosure()
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & strComputer & "rootcimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_SystemEnclosure", , 48)
For Each objItem In colItems
i = i + 1: Cells(i, 1) = "AudibleAlarm: " & objItem.AudibleAlarm
i = i + 1: Cells(i, 1) = "BreachDescription: " & objItem.BreachDescription
i = i + 1: Cells(i, 1) = "CableManagementStrategy: " &
objItem.CableManagementStrategy
i = i + 1: Cells(i, 1) = "Caption: " & objItem.Caption
i = i + 1: Cells(i, 1) = "ChassisTypes: " & objItem.ChassisTypes
i = i + 1: Cells(i, 1) = "CreationClassName: " & objItem.CreationClassName
i = i + 1: Cells(i, 1) = "CurrentRequiredOrProduced: " &
objItem.CurrentRequiredOrProduced
i = i + 1: Cells(i, 1) = "Depth: " & objItem.Depth
i = i + 1: Cells(i, 1) = "Description: " & objItem.Description
i = i + 1: Cells(i, 1) = "HeatGeneration: " & objItem.HeatGeneration
i = i + 1: Cells(i, 1) = "Height: " & objItem.Height
i = i + 1: Cells(i, 1) = "HotSwappable: " & objItem.HotSwappable
i = i + 1: Cells(i, 1) = "InstallDate: " & objItem.InstallDate
i = i + 1: Cells(i, 1) = "LockPresent: " & objItem.LockPresent
i = i + 1: Cells(i, 1) = "Manufacturer: " & objItem.Manufacturer
i = i + 1: Cells(i, 1) = "Model: " & objItem.Model
i = i + 1: Cells(i, 1) = "Name: " & objItem.Name
i = i + 1: Cells(i, 1) = "NumberOfPowerCords: " & objItem.NumberOfPowerCords
i = i + 1: Cells(i, 1) = "OtherIdentifyingInfo: " &
objItem.OtherIdentifyingInfo
i = i + 1: Cells(i, 1) = "PartNumber: " & objItem.PartNumber
i = i + 1: Cells(i, 1) = "PoweredOn: " & objItem.PoweredOn
i = i + 1: Cells(i, 1) = "Removable: " & objItem.Removable
i = i + 1: Cells(i, 1) = "Replaceable: " & objItem.Replaceable
i = i + 1: Cells(i, 1) = "SecurityBreach: " & objItem.SecurityBreach
i = i + 1: Cells(i, 1) = "SecurityStatus: " & objItem.SecurityStatus
i = i + 1: Cells(i, 1) = "SerialNumber: " & objItem.SerialNumber
i = i + 1: Cells(i, 1) = "ServiceDescriptions: " &
objItem.ServiceDescriptions
i = i + 1: Cells(i, 1) = "ServicePhilosophy: " & objItem.ServicePhilosophy
i = i + 1: Cells(i, 1) = "SKU: " & objItem.SKU
i = i + 1: Cells(i, 1) = "SMBIOSAssetTag: " & objItem.SMBIOSAssetTag
i = i + 1: Cells(i, 1) = "Status: " & objItem.Status
i = i + 1: Cells(i, 1) = "Tag: " & objItem.Tag
i = i + 1: Cells(i, 1) = "TypeDescriptions: " & objItem.TypeDescriptions
i = i + 1: Cells(i, 1) = "Version: " & objItem.Version
i = i + 1: Cells(i, 1) = "VisibleAlarm: " & objItem.VisibleAlarm
i = i + 1: Cells(i, 1) = "Weight: " & objItem.Weight
i = i + 1: Cells(i, 1) = "Width: " & objItem.Width
Next
End Sub
MP
"claudius" a écrit dans le message de
news:Bonjour à toutes et à tous,
Est-il possible, en VBA Excel, de trouver le N° de série de la carte mère
duPC (ou du PC lui-même s'il en a un) ?
Merci d'avance
--
claudius
Bonjour Michel,
Je te remercie pour ta réponse mais quand je lance tes macros, je n'ai que
les "libellés" : après les 2 points il n'y a rien !? (j'ai XP).
Peux-tu m'expliquer ?
Encore merci.
ClaudiusBonjour claudius;
Si tu as XP:
1 - Carte mère
Sub Win32_BaseBoard()
On Error Resume Next
Const strComputer$ = "."
Dim i%, objWMIService As Object, colItems As Object, objItem As Object
Set objWMIService = GetObject("winmgmts:" & strComputer &
"rootcimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard",
,
48)
For Each objItem In colItems
i = i + 1: Cells(i, 1) = "Caption: " & objItem.Caption
i = i + 1: Cells(i, 1) = "ConfigOptions: " & objItem.ConfigOptions
i = i + 1: Cells(i, 1) = "CreationClassName: " &
objItem.CreationClassName
i = i + 1: Cells(i, 1) = "Depth: " & objItem.Depth
i = i + 1: Cells(i, 1) = "Description: " & objItem.Description
i = i + 1: Cells(i, 1) = "Height: " & objItem.Height
i = i + 1: Cells(i, 1) = "HostingBoard: " & objItem.HostingBoard
i = i + 1: Cells(i, 1) = "HotSwappable: " & objItem.HotSwappable
i = i + 1: Cells(i, 1) = "InstallDate: " & objItem.InstallDate
i = i + 1: Cells(i, 1) = "Manufacturer: " & objItem.Manufacturer
i = i + 1: Cells(i, 1) = "Model: " & objItem.Model
i = i + 1: Cells(i, 1) = "Name: " & objItem.Name
i = i + 1: Cells(i, 1) = "OtherIdentifyingInfo: " &
objItem.OtherIdentifyingInfo
i = i + 1: Cells(i, 1) = "PartNumber: " & objItem.PartNumber
i = i + 1: Cells(i, 1) = "PoweredOn: " & objItem.PoweredOn
i = i + 1: Cells(i, 1) = "Product: " & objItem.Product
i = i + 1: Cells(i, 1) = "Removable: " & objItem.Removable
i = i + 1: Cells(i, 1) = "Replaceable: " & objItem.Replaceable
i = i + 1: Cells(i, 1) = "RequirementsDescription: " &
objItem.RequirementsDescription
i = i + 1: Cells(i, 1) = "RequiresDaughterBoard: " &
objItem.RequiresDaughterBoard
i = i + 1: Cells(i, 1) = "SerialNumber: " & objItem.SerialNumber
i = i + 1: Cells(i, 1) = "SKU: " & objItem.SKU
i = i + 1: Cells(i, 1) = "SlotLayout: " & objItem.SlotLayout
i = i + 1: Cells(i, 1) = "SpecialRequirements: " &
objItem.SpecialRequirements
i = i + 1: Cells(i, 1) = "Status: " & objItem.Status
i = i + 1: Cells(i, 1) = "Tag: " & objItem.Tag
i = i + 1: Cells(i, 1) = "Version: " & objItem.Version
i = i + 1: Cells(i, 1) = "Weight: " & objItem.Weight
i = i + 1: Cells(i, 1) = "Width: " & objItem.Width
Next
Set colItems = Nothing
Set objWMIService = Nothing
End Sub
2 - PC
Sub Win32_SystemEnclosure()
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & strComputer &
"rootcimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_SystemEnclosure", , 48)
For Each objItem In colItems
i = i + 1: Cells(i, 1) = "AudibleAlarm: " & objItem.AudibleAlarm
i = i + 1: Cells(i, 1) = "BreachDescription: " &
objItem.BreachDescription
i = i + 1: Cells(i, 1) = "CableManagementStrategy: " &
objItem.CableManagementStrategy
i = i + 1: Cells(i, 1) = "Caption: " & objItem.Caption
i = i + 1: Cells(i, 1) = "ChassisTypes: " & objItem.ChassisTypes
i = i + 1: Cells(i, 1) = "CreationClassName: " &
objItem.CreationClassName
i = i + 1: Cells(i, 1) = "CurrentRequiredOrProduced: " &
objItem.CurrentRequiredOrProduced
i = i + 1: Cells(i, 1) = "Depth: " & objItem.Depth
i = i + 1: Cells(i, 1) = "Description: " & objItem.Description
i = i + 1: Cells(i, 1) = "HeatGeneration: " & objItem.HeatGeneration
i = i + 1: Cells(i, 1) = "Height: " & objItem.Height
i = i + 1: Cells(i, 1) = "HotSwappable: " & objItem.HotSwappable
i = i + 1: Cells(i, 1) = "InstallDate: " & objItem.InstallDate
i = i + 1: Cells(i, 1) = "LockPresent: " & objItem.LockPresent
i = i + 1: Cells(i, 1) = "Manufacturer: " & objItem.Manufacturer
i = i + 1: Cells(i, 1) = "Model: " & objItem.Model
i = i + 1: Cells(i, 1) = "Name: " & objItem.Name
i = i + 1: Cells(i, 1) = "NumberOfPowerCords: " &
objItem.NumberOfPowerCords
i = i + 1: Cells(i, 1) = "OtherIdentifyingInfo: " &
objItem.OtherIdentifyingInfo
i = i + 1: Cells(i, 1) = "PartNumber: " & objItem.PartNumber
i = i + 1: Cells(i, 1) = "PoweredOn: " & objItem.PoweredOn
i = i + 1: Cells(i, 1) = "Removable: " & objItem.Removable
i = i + 1: Cells(i, 1) = "Replaceable: " & objItem.Replaceable
i = i + 1: Cells(i, 1) = "SecurityBreach: " & objItem.SecurityBreach
i = i + 1: Cells(i, 1) = "SecurityStatus: " & objItem.SecurityStatus
i = i + 1: Cells(i, 1) = "SerialNumber: " & objItem.SerialNumber
i = i + 1: Cells(i, 1) = "ServiceDescriptions: " &
objItem.ServiceDescriptions
i = i + 1: Cells(i, 1) = "ServicePhilosophy: " &
objItem.ServicePhilosophy
i = i + 1: Cells(i, 1) = "SKU: " & objItem.SKU
i = i + 1: Cells(i, 1) = "SMBIOSAssetTag: " & objItem.SMBIOSAssetTag
i = i + 1: Cells(i, 1) = "Status: " & objItem.Status
i = i + 1: Cells(i, 1) = "Tag: " & objItem.Tag
i = i + 1: Cells(i, 1) = "TypeDescriptions: " & objItem.TypeDescriptions
i = i + 1: Cells(i, 1) = "Version: " & objItem.Version
i = i + 1: Cells(i, 1) = "VisibleAlarm: " & objItem.VisibleAlarm
i = i + 1: Cells(i, 1) = "Weight: " & objItem.Weight
i = i + 1: Cells(i, 1) = "Width: " & objItem.Width
Next
End Sub
MP
"claudius" a écrit dans le message
de
news:Bonjour à toutes et à tous,
Est-il possible, en VBA Excel, de trouver le N° de série de la carte
mère
duPC (ou du PC lui-même s'il en a un) ?
Merci d'avance
--
claudius
Bonjour Michel,
Je te remercie pour ta réponse mais quand je lance tes macros, je n'ai que
les "libellés" : après les 2 points il n'y a rien !? (j'ai XP).
Peux-tu m'expliquer ?
Encore merci.
Claudius
Bonjour claudius;
Si tu as XP:
1 - Carte mère
Sub Win32_BaseBoard()
On Error Resume Next
Const strComputer$ = "."
Dim i%, objWMIService As Object, colItems As Object, objItem As Object
Set objWMIService = GetObject("winmgmts:\" & strComputer &
"rootcimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard",
,
48)
For Each objItem In colItems
i = i + 1: Cells(i, 1) = "Caption: " & objItem.Caption
i = i + 1: Cells(i, 1) = "ConfigOptions: " & objItem.ConfigOptions
i = i + 1: Cells(i, 1) = "CreationClassName: " &
objItem.CreationClassName
i = i + 1: Cells(i, 1) = "Depth: " & objItem.Depth
i = i + 1: Cells(i, 1) = "Description: " & objItem.Description
i = i + 1: Cells(i, 1) = "Height: " & objItem.Height
i = i + 1: Cells(i, 1) = "HostingBoard: " & objItem.HostingBoard
i = i + 1: Cells(i, 1) = "HotSwappable: " & objItem.HotSwappable
i = i + 1: Cells(i, 1) = "InstallDate: " & objItem.InstallDate
i = i + 1: Cells(i, 1) = "Manufacturer: " & objItem.Manufacturer
i = i + 1: Cells(i, 1) = "Model: " & objItem.Model
i = i + 1: Cells(i, 1) = "Name: " & objItem.Name
i = i + 1: Cells(i, 1) = "OtherIdentifyingInfo: " &
objItem.OtherIdentifyingInfo
i = i + 1: Cells(i, 1) = "PartNumber: " & objItem.PartNumber
i = i + 1: Cells(i, 1) = "PoweredOn: " & objItem.PoweredOn
i = i + 1: Cells(i, 1) = "Product: " & objItem.Product
i = i + 1: Cells(i, 1) = "Removable: " & objItem.Removable
i = i + 1: Cells(i, 1) = "Replaceable: " & objItem.Replaceable
i = i + 1: Cells(i, 1) = "RequirementsDescription: " &
objItem.RequirementsDescription
i = i + 1: Cells(i, 1) = "RequiresDaughterBoard: " &
objItem.RequiresDaughterBoard
i = i + 1: Cells(i, 1) = "SerialNumber: " & objItem.SerialNumber
i = i + 1: Cells(i, 1) = "SKU: " & objItem.SKU
i = i + 1: Cells(i, 1) = "SlotLayout: " & objItem.SlotLayout
i = i + 1: Cells(i, 1) = "SpecialRequirements: " &
objItem.SpecialRequirements
i = i + 1: Cells(i, 1) = "Status: " & objItem.Status
i = i + 1: Cells(i, 1) = "Tag: " & objItem.Tag
i = i + 1: Cells(i, 1) = "Version: " & objItem.Version
i = i + 1: Cells(i, 1) = "Weight: " & objItem.Weight
i = i + 1: Cells(i, 1) = "Width: " & objItem.Width
Next
Set colItems = Nothing
Set objWMIService = Nothing
End Sub
2 - PC
Sub Win32_SystemEnclosure()
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\" & strComputer &
"rootcimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_SystemEnclosure", , 48)
For Each objItem In colItems
i = i + 1: Cells(i, 1) = "AudibleAlarm: " & objItem.AudibleAlarm
i = i + 1: Cells(i, 1) = "BreachDescription: " &
objItem.BreachDescription
i = i + 1: Cells(i, 1) = "CableManagementStrategy: " &
objItem.CableManagementStrategy
i = i + 1: Cells(i, 1) = "Caption: " & objItem.Caption
i = i + 1: Cells(i, 1) = "ChassisTypes: " & objItem.ChassisTypes
i = i + 1: Cells(i, 1) = "CreationClassName: " &
objItem.CreationClassName
i = i + 1: Cells(i, 1) = "CurrentRequiredOrProduced: " &
objItem.CurrentRequiredOrProduced
i = i + 1: Cells(i, 1) = "Depth: " & objItem.Depth
i = i + 1: Cells(i, 1) = "Description: " & objItem.Description
i = i + 1: Cells(i, 1) = "HeatGeneration: " & objItem.HeatGeneration
i = i + 1: Cells(i, 1) = "Height: " & objItem.Height
i = i + 1: Cells(i, 1) = "HotSwappable: " & objItem.HotSwappable
i = i + 1: Cells(i, 1) = "InstallDate: " & objItem.InstallDate
i = i + 1: Cells(i, 1) = "LockPresent: " & objItem.LockPresent
i = i + 1: Cells(i, 1) = "Manufacturer: " & objItem.Manufacturer
i = i + 1: Cells(i, 1) = "Model: " & objItem.Model
i = i + 1: Cells(i, 1) = "Name: " & objItem.Name
i = i + 1: Cells(i, 1) = "NumberOfPowerCords: " &
objItem.NumberOfPowerCords
i = i + 1: Cells(i, 1) = "OtherIdentifyingInfo: " &
objItem.OtherIdentifyingInfo
i = i + 1: Cells(i, 1) = "PartNumber: " & objItem.PartNumber
i = i + 1: Cells(i, 1) = "PoweredOn: " & objItem.PoweredOn
i = i + 1: Cells(i, 1) = "Removable: " & objItem.Removable
i = i + 1: Cells(i, 1) = "Replaceable: " & objItem.Replaceable
i = i + 1: Cells(i, 1) = "SecurityBreach: " & objItem.SecurityBreach
i = i + 1: Cells(i, 1) = "SecurityStatus: " & objItem.SecurityStatus
i = i + 1: Cells(i, 1) = "SerialNumber: " & objItem.SerialNumber
i = i + 1: Cells(i, 1) = "ServiceDescriptions: " &
objItem.ServiceDescriptions
i = i + 1: Cells(i, 1) = "ServicePhilosophy: " &
objItem.ServicePhilosophy
i = i + 1: Cells(i, 1) = "SKU: " & objItem.SKU
i = i + 1: Cells(i, 1) = "SMBIOSAssetTag: " & objItem.SMBIOSAssetTag
i = i + 1: Cells(i, 1) = "Status: " & objItem.Status
i = i + 1: Cells(i, 1) = "Tag: " & objItem.Tag
i = i + 1: Cells(i, 1) = "TypeDescriptions: " & objItem.TypeDescriptions
i = i + 1: Cells(i, 1) = "Version: " & objItem.Version
i = i + 1: Cells(i, 1) = "VisibleAlarm: " & objItem.VisibleAlarm
i = i + 1: Cells(i, 1) = "Weight: " & objItem.Weight
i = i + 1: Cells(i, 1) = "Width: " & objItem.Width
Next
End Sub
MP
"claudius" <claudius@discussions.microsoft.com> a écrit dans le message
de
news:39E6381A-F4D3-47A1-BE6B-DA622815AAFF@microsoft.com...
Bonjour à toutes et à tous,
Est-il possible, en VBA Excel, de trouver le N° de série de la carte
mère
du
PC (ou du PC lui-même s'il en a un) ?
Merci d'avance
--
claudius
Bonjour Michel,
Je te remercie pour ta réponse mais quand je lance tes macros, je n'ai que
les "libellés" : après les 2 points il n'y a rien !? (j'ai XP).
Peux-tu m'expliquer ?
Encore merci.
ClaudiusBonjour claudius;
Si tu as XP:
1 - Carte mère
Sub Win32_BaseBoard()
On Error Resume Next
Const strComputer$ = "."
Dim i%, objWMIService As Object, colItems As Object, objItem As Object
Set objWMIService = GetObject("winmgmts:" & strComputer &
"rootcimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard",
,
48)
For Each objItem In colItems
i = i + 1: Cells(i, 1) = "Caption: " & objItem.Caption
i = i + 1: Cells(i, 1) = "ConfigOptions: " & objItem.ConfigOptions
i = i + 1: Cells(i, 1) = "CreationClassName: " &
objItem.CreationClassName
i = i + 1: Cells(i, 1) = "Depth: " & objItem.Depth
i = i + 1: Cells(i, 1) = "Description: " & objItem.Description
i = i + 1: Cells(i, 1) = "Height: " & objItem.Height
i = i + 1: Cells(i, 1) = "HostingBoard: " & objItem.HostingBoard
i = i + 1: Cells(i, 1) = "HotSwappable: " & objItem.HotSwappable
i = i + 1: Cells(i, 1) = "InstallDate: " & objItem.InstallDate
i = i + 1: Cells(i, 1) = "Manufacturer: " & objItem.Manufacturer
i = i + 1: Cells(i, 1) = "Model: " & objItem.Model
i = i + 1: Cells(i, 1) = "Name: " & objItem.Name
i = i + 1: Cells(i, 1) = "OtherIdentifyingInfo: " &
objItem.OtherIdentifyingInfo
i = i + 1: Cells(i, 1) = "PartNumber: " & objItem.PartNumber
i = i + 1: Cells(i, 1) = "PoweredOn: " & objItem.PoweredOn
i = i + 1: Cells(i, 1) = "Product: " & objItem.Product
i = i + 1: Cells(i, 1) = "Removable: " & objItem.Removable
i = i + 1: Cells(i, 1) = "Replaceable: " & objItem.Replaceable
i = i + 1: Cells(i, 1) = "RequirementsDescription: " &
objItem.RequirementsDescription
i = i + 1: Cells(i, 1) = "RequiresDaughterBoard: " &
objItem.RequiresDaughterBoard
i = i + 1: Cells(i, 1) = "SerialNumber: " & objItem.SerialNumber
i = i + 1: Cells(i, 1) = "SKU: " & objItem.SKU
i = i + 1: Cells(i, 1) = "SlotLayout: " & objItem.SlotLayout
i = i + 1: Cells(i, 1) = "SpecialRequirements: " &
objItem.SpecialRequirements
i = i + 1: Cells(i, 1) = "Status: " & objItem.Status
i = i + 1: Cells(i, 1) = "Tag: " & objItem.Tag
i = i + 1: Cells(i, 1) = "Version: " & objItem.Version
i = i + 1: Cells(i, 1) = "Weight: " & objItem.Weight
i = i + 1: Cells(i, 1) = "Width: " & objItem.Width
Next
Set colItems = Nothing
Set objWMIService = Nothing
End Sub
2 - PC
Sub Win32_SystemEnclosure()
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & strComputer &
"rootcimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_SystemEnclosure", , 48)
For Each objItem In colItems
i = i + 1: Cells(i, 1) = "AudibleAlarm: " & objItem.AudibleAlarm
i = i + 1: Cells(i, 1) = "BreachDescription: " &
objItem.BreachDescription
i = i + 1: Cells(i, 1) = "CableManagementStrategy: " &
objItem.CableManagementStrategy
i = i + 1: Cells(i, 1) = "Caption: " & objItem.Caption
i = i + 1: Cells(i, 1) = "ChassisTypes: " & objItem.ChassisTypes
i = i + 1: Cells(i, 1) = "CreationClassName: " &
objItem.CreationClassName
i = i + 1: Cells(i, 1) = "CurrentRequiredOrProduced: " &
objItem.CurrentRequiredOrProduced
i = i + 1: Cells(i, 1) = "Depth: " & objItem.Depth
i = i + 1: Cells(i, 1) = "Description: " & objItem.Description
i = i + 1: Cells(i, 1) = "HeatGeneration: " & objItem.HeatGeneration
i = i + 1: Cells(i, 1) = "Height: " & objItem.Height
i = i + 1: Cells(i, 1) = "HotSwappable: " & objItem.HotSwappable
i = i + 1: Cells(i, 1) = "InstallDate: " & objItem.InstallDate
i = i + 1: Cells(i, 1) = "LockPresent: " & objItem.LockPresent
i = i + 1: Cells(i, 1) = "Manufacturer: " & objItem.Manufacturer
i = i + 1: Cells(i, 1) = "Model: " & objItem.Model
i = i + 1: Cells(i, 1) = "Name: " & objItem.Name
i = i + 1: Cells(i, 1) = "NumberOfPowerCords: " &
objItem.NumberOfPowerCords
i = i + 1: Cells(i, 1) = "OtherIdentifyingInfo: " &
objItem.OtherIdentifyingInfo
i = i + 1: Cells(i, 1) = "PartNumber: " & objItem.PartNumber
i = i + 1: Cells(i, 1) = "PoweredOn: " & objItem.PoweredOn
i = i + 1: Cells(i, 1) = "Removable: " & objItem.Removable
i = i + 1: Cells(i, 1) = "Replaceable: " & objItem.Replaceable
i = i + 1: Cells(i, 1) = "SecurityBreach: " & objItem.SecurityBreach
i = i + 1: Cells(i, 1) = "SecurityStatus: " & objItem.SecurityStatus
i = i + 1: Cells(i, 1) = "SerialNumber: " & objItem.SerialNumber
i = i + 1: Cells(i, 1) = "ServiceDescriptions: " &
objItem.ServiceDescriptions
i = i + 1: Cells(i, 1) = "ServicePhilosophy: " &
objItem.ServicePhilosophy
i = i + 1: Cells(i, 1) = "SKU: " & objItem.SKU
i = i + 1: Cells(i, 1) = "SMBIOSAssetTag: " & objItem.SMBIOSAssetTag
i = i + 1: Cells(i, 1) = "Status: " & objItem.Status
i = i + 1: Cells(i, 1) = "Tag: " & objItem.Tag
i = i + 1: Cells(i, 1) = "TypeDescriptions: " & objItem.TypeDescriptions
i = i + 1: Cells(i, 1) = "Version: " & objItem.Version
i = i + 1: Cells(i, 1) = "VisibleAlarm: " & objItem.VisibleAlarm
i = i + 1: Cells(i, 1) = "Weight: " & objItem.Weight
i = i + 1: Cells(i, 1) = "Width: " & objItem.Width
Next
End Sub
MP
"claudius" a écrit dans le message
de
news:Bonjour à toutes et à tous,
Est-il possible, en VBA Excel, de trouver le N° de série de la carte
mère
duPC (ou du PC lui-même s'il en a un) ?
Merci d'avance
--
claudius