ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find folder macro was in (https://www.excelbanter.com/excel-programming/293242-find-folder-macro.html)

Fred Smith

Find folder macro was in
 
I have all my macros in one file. I run them from a custom menu item.
However, depending on the computer the macros are run on, the folder the
file is loaded from could be different.

Is it possible to determine the folder the macro file was loaded from?

--
Regards,
Fred
Please reply to newsgroup, not e-mail




mudraker[_166_]

Find folder macro was in
 
fPath = ThisWorkbook.Pat

--
Message posted from http://www.ExcelForum.com


A.W.J. Ales

Find folder macro was in
 
Fred,

If you take up this function in (all versions) of your macrofile, that
function will return the path of the (loaded) version of the file.
(NB Not tested)

Function MacroFilePath()
MacroFilePath = Workbooks("Persnlk.xls").Path
End Function

Ofcourse : Change persnlk.xls with the name of your macro file.

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *

"Fred Smith" wrote in message
...
I have all my macros in one file. I run them from a custom menu item.
However, depending on the computer the macros are run on, the folder the
file is loaded from could be different.

Is it possible to determine the folder the macro file was loaded from?

--
Regards,
Fred
Please reply to newsgroup, not e-mail






Robin Hammond[_2_]

Find folder macro was in
 
Fred,

If you mean, can the macro determine it's own location, yes. Use
thisworkbook.path.

If you mean something else, you'll need to explain...

HTH,

Robin Hammond
www.enhanceddatasystems.com

"Fred Smith" wrote in message
...
I have all my macros in one file. I run them from a custom menu item.
However, depending on the computer the macros are run on, the folder the
file is loaded from could be different.

Is it possible to determine the folder the macro file was loaded from?

--
Regards,
Fred
Please reply to newsgroup, not e-mail






Fred Smith

Find folder macro was in
 
That's exactly it. Thanks for your help.

--
Regards,
Fred
Please reply to newsgroup, not e-mail


"Robin Hammond" wrote in message
...
Fred,

If you mean, can the macro determine it's own location, yes. Use
thisworkbook.path.

If you mean something else, you'll need to explain...

HTH,

Robin Hammond
www.enhanceddatasystems.com

"Fred Smith" wrote in message
...
I have all my macros in one file. I run them from a custom menu item.
However, depending on the computer the macros are run on, the folder the
file is loaded from could be different.

Is it possible to determine the folder the macro file was loaded from?

--
Regards,
Fred
Please reply to newsgroup, not e-mail









All times are GMT +1. The time now is 10:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com