Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default using environment variable in macropath

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default using environment variable in macropath

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
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





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default using environment variable in macropath

Markus,
If you are trying to run a routine in ..XLStart\Personal.xls, it will be
open and the path is irrelevant. Use

Application.Run "Personal.xls!YourRoutine"

Otherwise, you cannot run code in a workbook that is not open.

NickHK

"M. Mix" wrote in message
...
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







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default using environment variable in macropath

Hi Nick,

that donīt work. I can fill in the path as you described but if you refresh
the view or reopen the button and look at the path you see that the path is
deposited as hard coded path. Still having the inicial problem :-/

But thank you for the idea.

I cant imagine that i am the only one with that problem. How are the
otherone handling with the issue of personalized macroīs and its path?
Maybe i have to take a different way to the goal.

Thanks

Markus

"NickHK" schrieb im Newsbeitrag
...
Markus,
If you are trying to run a routine in ..XLStart\Personal.xls, it will be
open and the path is irrelevant. Use

Application.Run "Personal.xls!YourRoutine"

Otherwise, you cannot run code in a workbook that is not open.

NickHK

"M. Mix" wrote in message
...
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











  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default using environment variable in macropath

Hi Markus,
perhaps Application.DefaultFilePath
see if http://www.mvps.org/dmcritchie/excel/property.htm
is of any help to you.

David McRitchie


On Feb 6, 2:30 am, "M. Mix" wrote:
Hi Nick,

that donīt work. I can fill in the path as you described but if you refresh
the view or reopen the button and look at the path you see that the path is
deposited as hard coded path. Still having the inicial problem :-/

But thank you for the idea.

I cant imagine that i am the only one with that problem. How are the
otherone handling with the issue of personalized macroīs and its path?
Maybe i have to take a different way to the goal.

Thanks

Markus

"NickHK" schrieb im . gbl...

Markus,
If you are trying to run a routine in ..XLStart\Personal.xls, it will be
open and the path is irrelevant. Use


Application.Run "Personal.xls!YourRoutine"


Otherwise, you cannot run code in a workbook that is not open.


NickHK


"M. Mix" wrote in message
...
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



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
Finding temp folder. Environment variable? Don Wiss Excel Programming 6 August 15th 06 06:07 PM
Environment Variable Names Chaplain Doug Excel Programming 3 April 20th 06 03:33 PM
Can you set a Window's Environment variable in VB Ken Soenen Excel Programming 3 March 12th 06 06:19 PM
Environment Variable Andibevan[_4_] Excel Programming 5 August 3rd 05 02:17 PM
How can I invoke windows environment variable in excel Bert van den Brink Excel Programming 0 August 6th 03 08:46 PM


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