View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
M. Mix M. Mix is offline
external usenet poster
 
Posts: 3
Default using environment variable in macropath

good morning!

Tom, unfotunately i donīt know what you mean.
I have a button in Excel. Behind the button i need the macropath described
below.

I cant use code in the path or am i wrong?

Maybe i choose the wrong subnewsgroup :-/ i am sorry. `

Thanks

Markus


"Tom Ogilvy" schrieb im Newsbeitrag
...
sFile = environ("USERPROFILE") _
& "\Anwendungsdaten\Microsoft\Excel\XLStart\PERSONL. XLS"


--
regards,
Tom Ogilvy


"M. Mix" wrote:

Hiho,

i have a problem with a macro which is linked behind an excel button.
I want to use the environment variable %USERPROFILE% in the macro path
because the macro is been used from many users.

The path at this time is hard coded: C:\Dokumente und
Einstellungen\mmustermann\Eigene
Dateien\Anwendungsdaten\Microsoft\Excel\XLStart\PE RSONL.XLS

I want to modify the path to:
%USERPROFILE%\Anwendungsdaten\Microsoft\Excel\XLSt art\PERSONL.XLS

When i modify the path the result is the following: C:\Dokumente und
Einstellungen\mmustermann\Eigene

Dateien\%USERPOROFILE%\Anwendungsdaten\Microsoft\E xcel\XLStart\PERSONL.XLS

Any hints how to solve this ?

Thx

Markus