Thread: Computer name
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Rick Rothstein \(MVP - VB\)[_1126_] Rick Rothstein \(MVP - VB\)[_1126_] is offline
external usenet poster
 
Posts: 1
Default Computer name

The statements I posted are the "full code" and assume you are assigning the
computer name to the variable CN and assigning the Product Code (which may
or may not be what you intended when you said "product ID") to the variable
PC... just assign them to your own variables instead.

Perhaps this will help you see what is going on. Type this statement in the
Immediate window and hit the Return key...

MsgBox Environ("ComputerName")

Now do the same for this statement...

MsgBox Application.ProductCode

Rick


"art" wrote in message
...
Can you please give me the full vba code?

Thanks.

"Rick Rothstein (MVP - VB)" wrote:

Using VBA... you can get the computer name with this function call...

CN = Environ("ComputerName")

What do you expect the product ID to look like? I'm guessing the value
from
this property call is not what you are looking for?

PC = Application.ProductCode

Rick


"art" wrote in message
...
Hello:

Does anybody know how to display through a formula or vba the computer
name
in excel 2007?
And what about the Windows product ID?
Please let me know.