Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Environ () Function

Can someone explain to me how the Environ () works. I saw it been used in
another example code here as follows:

Private Sub Workbook_Open ()
Dim myB as Workbook
If Environ("COMPUTERNAME") = "janphi" Then

I tried to use the same concept for my code:

If Environ("COMPUTERNAME") = "Work_Laptop" Then
Else
InputForm1.Show
End If

but the InputForm1 still come up. I want InputForm1 to only load when
someone else opens the file but when I open the file from my computer, I
don't want it to open. That is what I am trying to accomplish.
Any ideas?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Environ () Function

Ayo

Try the below in your immediate window and compare the name with what you
have given "Work_Laptop"

?Environ("COMPUTERNAME")

I would suggest to use Environ("USERNAME") .

If this post helps click Yes
---------------
Jacob Skaria


"Ayo" wrote:

Can someone explain to me how the Environ () works. I saw it been used in
another example code here as follows:

Private Sub Workbook_Open ()
Dim myB as Workbook
If Environ("COMPUTERNAME") = "janphi" Then

I tried to use the same concept for my code:

If Environ("COMPUTERNAME") = "Work_Laptop" Then
Else
InputForm1.Show
End If

but the InputForm1 still come up. I want InputForm1 to only load when
someone else opens the file but when I open the file from my computer, I
don't want it to open. That is what I am trying to accomplish.
Any ideas?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Environ () Function

If Environ("USERNAME") < "janphi" Then
InputForm1.Show
End If


"Ayo" wrote in message
...
Can someone explain to me how the Environ () works. I saw it been used in
another example code here as follows:

Private Sub Workbook_Open ()
Dim myB as Workbook
If Environ("COMPUTERNAME") = "janphi" Then

I tried to use the same concept for my code:

If Environ("COMPUTERNAME") = "Work_Laptop" Then
Else
InputForm1.Show
End If

but the InputForm1 still come up. I want InputForm1 to only load when
someone else opens the file but when I open the file from my computer, I
don't want it to open. That is what I am trying to accomplish.
Any ideas?



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
Environ user tracking geraintathomas Excel Programming 4 January 11th 06 12:26 PM
Environ function. Tom Ogilvy Excel Programming 1 April 14th 05 05:04 PM
Environ Function Brent Bowen Excel Programming 1 October 7th 04 04:58 PM
Environ() Jan Kronsell[_3_] Excel Programming 5 February 29th 04 09:49 AM
Environ()- help DJ Excel Programming 2 November 13th 03 06:26 AM


All times are GMT +1. The time now is 03:02 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"