LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default macro for different users... kind of

i am using the line below along with variations throughout in a macro:

ActiveWorkbook.SaveAs "C:\Users\jat\Desktop\Orders\" & fname & ".xlsx", _

the problem that i have is the macro will save on my desktop because it is
my profile's desktop. if i wanted to put the macro on another user's
profile, i do not want to go changing the macro everytime. can the line be
changed so that it goes to the current user's desktop?

i was thinking something like this:

Function ThisUser()
ThisUser = Environ("UserName")
End Function

and the line would be:
ActiveWorkbook.SaveAs "C:\Users\" & %thisuser% & "\Desktop\Orders\" & fname
& ".xlsx", _

this seems a bit too easy, so i think it's wrong... would it work?

jat

 
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 works for some users and not others kfell Excel Discussion (Misc queries) 6 April 17th 07 02:41 PM
macro works for some users and doesn't for others Pooja Excel Discussion (Misc queries) 2 October 27th 05 08:27 PM
Kind of embedded macro Svedbo Active Excel Programming 4 August 17th 05 01:43 PM
I have a kind of complex macro or vb script I want to program but do not know? bjwoodruff Excel Programming 4 June 14th 05 10:35 PM
Help - Automating a file.. Adding Users , Deleting users, Changing Tim Harding Excel Worksheet Functions 0 March 16th 05 01:25 PM


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