#1   Report Post  
Posted to microsoft.public.excel.misc
Art Art is offline
external usenet poster
 
Posts: 587
Default Computer name

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Computer name

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.


  #3   Report Post  
Posted to microsoft.public.excel.misc
Art Art is offline
external usenet poster
 
Posts: 587
Default Computer name

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.



  #4   Report Post  
Posted to microsoft.public.excel.misc
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.




  #5   Report Post  
Posted to microsoft.public.excel.misc
Art Art is offline
external usenet poster
 
Posts: 587
Default Computer name

It doesnt work. Can you send me the full code? HOw do I enter it in a module?
just MsgBox Environ("ComputerName")? And how Do I use the formula after
wards?

P.S. the product ID I meant was another way I want to identify the computer
instead of using the computer name.

Thanks

"Rick Rothstein (MVP - VB)" wrote:

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.






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Computer name

Actually, the code does work, but I am thinking you are not as familiar with
VBA coding as your original posting may have suggested. Here are the steps
you can take to see the computer's name... From any worksheet, right click
the tab at the bottom of the worksheet and select View Code. Copy/Paste this
code into the window that appeared when you did this...

Sub SeeComputerName()
MsgBox "My computer's name: " & Environ("ComputerName")
End Sub

Now, go back to your worksheet, press Alt+F8 and select the SeeComputerName
item from the list that appears and click the Run button. Now, since
implementing this basic code cause you problems, I am going to suggest you
read up on creating macros before you continue trying to do more complicated
programming. Check out this link as a starter...

http://www.anthony-vba.kefra.com/index_011.htm

(start with the 3 basic tutorials) and, perhaps, buying a basic Excel VBA
book to read might be helpful also.

Rick


"art" wrote in message
...
It doesnt work. Can you send me the full code? HOw do I enter it in a
module?
just MsgBox Environ("ComputerName")? And how Do I use the formula after
wards?

P.S. the product ID I meant was another way I want to identify the
computer
instead of using the computer name.

Thanks

"Rick Rothstein (MVP - VB)" wrote:

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.





  #7   Report Post  
Posted to microsoft.public.excel.misc
Art Art is offline
external usenet poster
 
Posts: 587
Default Computer name

How can I get this result in a formula?

Sub MyprodID()
MsgBox "My ProgID is " & _
Application.COMAddIns(1).progID & _
" and my GUID is " & _
Application.COMAddIns(1).GUID
End Sub


That means I should have the formula to be able to see the same results as
in the msg box?

"Rick Rothstein (MVP - VB)" wrote:

Actually, the code does work, but I am thinking you are not as familiar with
VBA coding as your original posting may have suggested. Here are the steps
you can take to see the computer's name... From any worksheet, right click
the tab at the bottom of the worksheet and select View Code. Copy/Paste this
code into the window that appeared when you did this...

Sub SeeComputerName()
MsgBox "My computer's name: " & Environ("ComputerName")
End Sub

Now, go back to your worksheet, press Alt+F8 and select the SeeComputerName
item from the list that appears and click the Run button. Now, since
implementing this basic code cause you problems, I am going to suggest you
read up on creating macros before you continue trying to do more complicated
programming. Check out this link as a starter...

http://www.anthony-vba.kefra.com/index_011.htm

(start with the 3 basic tutorials) and, perhaps, buying a basic Excel VBA
book to read might be helpful also.

Rick


"art" wrote in message
...
It doesnt work. Can you send me the full code? HOw do I enter it in a
module?
just MsgBox Environ("ComputerName")? And how Do I use the formula after
wards?

P.S. the product ID I meant was another way I want to identify the
computer
instead of using the computer name.

Thanks

"Rick Rothstein (MVP - VB)" wrote:

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.






  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Computer name

I really do not think those properties are what you want... on my system
they return the AddIn name and GUID for my Dymo Label printer. In any event,
assuming you really do want them (or if you find what you actually want
later on), the method to be able to display these results in a cell on a
worksheet using a formula (known as a User Defined Function or UDF for
short) in the cell is as follows. Go into the VB editor and put the
following code in a Module (get the Module the same way I told you on one of
your other posts in another newsgroup... click Insert/Module from the VB
editor's menu bar)...

Function GetProgIDs()
GetProgIDs = Application.COMAddIns(1).progID & " -- " & _
Application.COMAddIns(1).GUID
End Function

Now, back on your worksheet, type this into any cell....

=GetProgIDs()

(the parentheses are required) and the information you asked about will be
displayed in the cell.

Rick


"art" wrote in message
...
How can I get this result in a formula?

Sub MyprodID()
MsgBox "My ProgID is " & _
Application.COMAddIns(1).progID & _
" and my GUID is " & _
Application.COMAddIns(1).GUID
End Sub


That means I should have the formula to be able to see the same results as
in the msg box?

"Rick Rothstein (MVP - VB)" wrote:

Actually, the code does work, but I am thinking you are not as familiar
with
VBA coding as your original posting may have suggested. Here are the
steps
you can take to see the computer's name... From any worksheet, right
click
the tab at the bottom of the worksheet and select View Code. Copy/Paste
this
code into the window that appeared when you did this...

Sub SeeComputerName()
MsgBox "My computer's name: " & Environ("ComputerName")
End Sub

Now, go back to your worksheet, press Alt+F8 and select the
SeeComputerName
item from the list that appears and click the Run button. Now, since
implementing this basic code cause you problems, I am going to suggest
you
read up on creating macros before you continue trying to do more
complicated
programming. Check out this link as a starter...

http://www.anthony-vba.kefra.com/index_011.htm

(start with the 3 basic tutorials) and, perhaps, buying a basic Excel VBA
book to read might be helpful also.

Rick


"art" wrote in message
...
It doesnt work. Can you send me the full code? HOw do I enter it in a
module?
just MsgBox Environ("ComputerName")? And how Do I use the formula after
wards?

P.S. the product ID I meant was another way I want to identify the
computer
instead of using the computer name.

Thanks

"Rick Rothstein (MVP - VB)" wrote:

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.







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
Formatting From Computer to Computer bighurt87 Excel Discussion (Misc queries) 2 April 29th 08 07:12 PM
Formulaed cell response varies from computer to computer WKH Excel Discussion (Misc queries) 3 November 21st 07 06:37 PM
Display size difference- PC computer vs. Mac computer? dk_ Excel Discussion (Misc queries) 1 October 17th 06 05:48 AM
How do I copy all Excel files from old computer to new computer? Rfarsh Excel Discussion (Misc queries) 2 December 20th 05 03:23 AM
Autocomplete works with my home computer but not the office computer Andy Excel Discussion (Misc queries) 4 December 11th 04 07:21 PM


All times are GMT +1. The time now is 08:01 AM.

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"