Thread: Username
View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Tom Hutchins Tom Hutchins is offline
external usenet poster
 
Posts: 1,069
Default Username

Clearly, there is no problem with the code. It must be an environmental
(system) problem, Excel has become corrupted, or there is a conflict with
another program.

First, I would double-check the references in the VBE on the computers that
won't run the Environ("username") statement. Maybe, for example, your
workbook was saved with a reference to the Excel 11.0 Object Library but
those machines only have the Excel 10.0 Object Library.

Second, I would check what add-ins, if any, are enabled on those machines.
Some add-ins (like Hyperion's SmartView) can alter or disable normal Excel
functions. Disable any add-ins not found on the machines that work, and see
if Environ("username") works then.

Hutch

"Oldjay" wrote:

I can open a new workbook paste the code and get Lan ID
When I insert a new module in the existing workbook and paste the code I get
the same error. It's got to be something in this machine as the program works
with Environ("username") on other machines. This a 3.5M estimating program
with many menus and modules and more than 75 Subs.

Is there any other thing that I can look for?

"Tom Hutchins" wrote:

For me,

?Environ(49) displays nothing
?Environ("username") displays my LAN ID

Hutch

"timmg" wrote:

What does

?Environ(49)

or

?Environ("username")

display when entered directly in the immediate window? (ctrl + G)

tim