#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default File Path

Help needed.

I created a macro that was used only by myself, however this macro now needs
to be used by others.

The macro opens files saved in my c:\documents and settings\max28052\ etc.
The required files have been exported from the corporate database, the files
are automatically named and saved to the users c:\documents and
settings\"username - of the logged on user"\.

I would like to know if I can change my macro to open the required file
regardless of the logged on user. eg Currently my macro has the full file
path c:\documents and settings\max28052\help.xls is there any way it read
c:\documents and settings\"username"\help.xls so that I do not have to
recreate a macro for each individual officer.

Any help would be greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default File Path


If you mean the username as in the windows log in name then yes like
this:

Code:
--------------------
c:\documents and settings\" & Environ("username") & "\help.xls"
--------------------
you can use the application username but this can be chanegd by the user
at will or may not even be in place so your code would fail.

Max2073;579372 Wrote:
Help needed.

I created a macro that was used only by myself, however this macro now
needs
to be used by others.

The macro opens files saved in my c:\documents and settings\max28052\
etc.
The required files have been exported from the corporate database, the
files
are automatically named and saved to the users c:\documents and
settings\"username - of the logged on user"\.

I would like to know if I can change my macro to open the required file
regardless of the logged on user. eg Currently my macro has the full
file
path c:\documents and settings\max28052\help.xls is there any way it
read
c:\documents and settings\"username"\help.xls so that I do not have to
recreate a macro for each individual officer.

Any help would be greatly appreciated.



--
Simon Lloyd

Regards,
Simon Lloyd
'Microsoft Office Help' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: 1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=160189

Microsoft Office Help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default File Path


take a look here
'Daily Dose of Excel » Blog Archive » Get the Path to My Documents in
VBA' (http://tinyurl.com/ydmslhs) and here 'Locating Home My Documents
Folder - Excel Help & Excel Macro Help'
(http://www.ozgrid.com/forum/showthread.php?t=65466)


--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: 558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=160189

Microsoft Office Help

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
File Path Too Long? Not Anymore! Check out Long Path Tool Max Loger Excel Discussion (Misc queries) 1 March 24th 17 07:59 AM
http://CannotDeleteFile.net - Cannot Delete File? Try Long Path ToolFilename is too long? Computer Complaining Your Filename Is Too Long? TheLong Path Tool Can Help While most people can go about their businessblissfully unaware of the Windo Max Loger Excel Discussion (Misc queries) 0 June 14th 11 04:30 PM
Creating Excel file that points to relative path .cub file NewUser1 Excel Programming 0 January 11th 08 03:59 PM
Formula too long - new file path is shorter than old file path - Excel 2003 Greg J Excel Worksheet Functions 1 November 22nd 06 05:16 PM
How set file open path to filepath of file opened with Explorer ? RandyDtg1 Excel Programming 0 May 14th 04 02:05 AM


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