Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default getting same save-on-close macro to work from different networklocations

Thanks for the prompt reply, BUT..

I've not been able to use the environ() function to identify the machine
on which the program is running, possibly because it is was not yet an
easily accessed feature at the time my version of Excel (Excel97) and
Visual Basic were published. My reason is that the following macro
returns a blank,

Dim CompName
Sub what_machine()
CompName = Environ("COMPUTERNAME")
ActiveCell.Value = CompName
End Sub

even though (1) the machine appears to have name "Pentium_IV" when you
examine the list of things connected to my local network, (2) Visual
basic does not declare it an invalid function and (3) when I run
MSinfo32 from RUN, it shows
"On "PENTIUM_IV" as "Michael"

I also tried without success using the function Environ$ although the I
don't know when one would use Environ and when one would use Environ$.

I'm not currently anxious to upgrade to a newer version of office
because, except for this problem, EXCEL97 meets all my needs and runs
with lightning speed. Moreoverm I have noted that the function is
referred to in the context of Microsoft Visual Basic for MSDOS Version
1.0 at:

http://support.microsoft.com/default...kb;en-us;69846

This suggests that with additional code, one might be able to get the
Environ info from the operating system.


Is there another way to: (1) identify the machine on which the EXCEL
program is running or (2) specify the path, so I can tailor
SaveOnClose() to always save to the same machine????





Tom Ogilvy wrote:
Option 1 shouldn't be that hard

if environ("COMPUTERNAME") = "AMD" then

else

End if


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
Macro to open, Update links, save and close workbooks Anton Excel Discussion (Misc queries) 0 January 7th 10 03:18 AM
Macro to save and close, then copy file NewSysAdmin Excel Discussion (Misc queries) 2 December 2nd 09 03:24 PM
How to code the Macro to save and close a file? Eric Excel Discussion (Misc queries) 7 June 10th 07 03:28 PM
Macro to save & close all opened files James A Excel Discussion (Misc queries) 1 December 23rd 06 05:16 AM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM


All times are GMT +1. The time now is 04:54 AM.

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

About Us

"It's about Microsoft Excel"