Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default PC Serial number recall

Is there a way to pull the PC serial number or PC user name preferable serial
number.... using vb so I can record it in a file indicating from which
computer the update was made?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default PC Serial number recall

Try

environ("COMPUTERNAME")

or

environ("SERIAL")

--
HTH,

Barb Reinhardt



"Alberto Ast" wrote:

Is there a way to pull the PC serial number or PC user name preferable serial
number.... using vb so I can record it in a file indicating from which
computer the update was made?

  #3   Report Post  
Posted to microsoft.public.excel.programming
GS GS is offline
external usenet poster
 
Posts: 364
Default PC Serial number recall

<AFAIKEnviron() doesn't return a serial#.
Here's a reusable function that will return the manufacturer's BIOS serial
number of the computer the function is run on.

Function GetPC_SerialNo() As String
' Gets the serial number of a PC's BIOS

Dim sComputer As String, sSerialNo As String
Dim oWMI As Variant
Dim vSettings As Variant, vBIOS As Variant

sComputer = "winmgmts:{impersonationLevel=impersonate}!\\.\roo t\cimv2"
Set oWMI = GetObject(sComputer)
Set vSettings = oWMI.ExecQuery("Select * from Win32_BIOS")
For Each vBIOS In vSettings
GetPC_SerialNo = Trim(vBIOS.SerialNumber)
Next
End Function '//GetPC_SerialNo

HTH
Kind regards,
Garry
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default PC Serial number recall

Serial did not work but computer name did. Thanks.

"Barb Reinhardt" wrote:

Try

environ("COMPUTERNAME")

or

environ("SERIAL")

--
HTH,

Barb Reinhardt



"Alberto Ast" wrote:

Is there a way to pull the PC serial number or PC user name preferable serial
number.... using vb so I can record it in a file indicating from which
computer the update was made?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default PC Serial number recall

Did work great... not I have serial and computer name.
Great learning today.
Thanks.

"GS" wrote:

<AFAIKEnviron() doesn't return a serial#.
Here's a reusable function that will return the manufacturer's BIOS serial
number of the computer the function is run on.

Function GetPC_SerialNo() As String
' Gets the serial number of a PC's BIOS

Dim sComputer As String, sSerialNo As String
Dim oWMI As Variant
Dim vSettings As Variant, vBIOS As Variant

sComputer = "winmgmts:{impersonationLevel=impersonate}!\\.\roo t\cimv2"
Set oWMI = GetObject(sComputer)
Set vSettings = oWMI.ExecQuery("Select * from Win32_BIOS")
For Each vBIOS In vSettings
GetPC_SerialNo = Trim(vBIOS.SerialNumber)
Next
End Function '//GetPC_SerialNo

HTH
Kind regards,
Garry



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default PC Serial number recall

Environ("COMPUTERNAME") and Environ("USERNAME") should give you pretty
definitive information. (Not only the computer, but also the user.)
I didn't find a PC Serial Number in the Environment Variables

"Alberto Ast" wrote:

Is there a way to pull the PC serial number or PC user name preferable serial
number.... using vb so I can record it in a file indicating from which
computer the update was made?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Serial Number Fareez Excel Worksheet Functions 8 January 24th 09 11:50 PM
Look up part of a number within a serial number and cpy back assoc Seantastic Excel Worksheet Functions 9 November 3rd 08 04:10 PM
To list down all SN (Serial Number) Andri Excel Worksheet Functions 6 September 16th 08 04:36 PM
Serial Number Jason Zischke Excel Programming 4 February 9th 06 06:05 PM
generate serial number john douglass Excel Worksheet Functions 0 November 5th 04 10:49 PM


All times are GMT +1. The time now is 12:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"