Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formatting From Computer to Computer | Excel Discussion (Misc queries) | |||
Formulaed cell response varies from computer to computer | Excel Discussion (Misc queries) | |||
Display size difference- PC computer vs. Mac computer? | Excel Discussion (Misc queries) | |||
How do I copy all Excel files from old computer to new computer? | Excel Discussion (Misc queries) | |||
Autocomplete works with my home computer but not the office computer | Excel Discussion (Misc queries) |