![]() |
Computer Name
|
Computer Name
Hi Mark,
Here's one way to do it: Private Declare Function GetComputerNameA Lib "kernel32" _ (ByVal lpBuffer As String, ByRef nSize As Long) As Long Sub GetMachineName() Dim lLength As Long Dim szNameBuffer As String lLength = 255 szNameBuffer = String$(lLength, vbNullChar) GetComputerNameA szNameBuffer, lLength MsgBox Left$(szNameBuffer, lLength) End Sub -- Rob Bovey, MCSE, MCSD, Excel MVP Application Professionals http://www.appspro.com/ * Please post all replies to this newsgroup * * I delete all unsolicited e-mail responses * "Mark Scholes" wrote in message ... Hi, I need to know the name of the machine that the spreadsheet is running on. So I can send the output to the local printer. Thanks MarkS |
Computer Name
"Mark Scholes" wrote...
I need to know the name of the machine that the spreadsheet is running on. So I can send the output to the local printer. Sending output to the default printer won't work? -- To top-post is human, to bottom-post and snip is sublime. |
Computer Name
|
All times are GMT +1. The time now is 12:26 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com