Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Computer Name

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

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default 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.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default Computer Name

Environ("computername") returns the value of the environment variable
"computername."

"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



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
Row Height variations from computer to computer on same workbook Barb Reinhardt Excel Discussion (Misc queries) 1 April 20th 10 07:06 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 11:44 AM.

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

About Us

"It's about Microsoft Excel"