File Path

M

Max2073

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.
 
S

Simon Lloyd

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

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

Max2073;579372 said:
Help needed

I created a macro that was used only by myself, however this macro no
need
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, th
file
are automatically named and saved to the users c:\documents an
settings\"username - of the logged on user"\

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

Any help would be greatly appreciated

--
Simon Lloy

Regards
Simon Lloy
'Microsoft Office Help' (http://www.thecodecage.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

File Path 1
File Path - Macros 3
File Path - Macro 1
File Path 2
File Path 1
Path and File 1
Path and File 1
Automatically opening file saved to someone "Documents&Sett' direc 2

Top