ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Workbook path (https://www.excelbanter.com/excel-discussion-misc-queries/20008-workbook-path.html)

nc

Workbook path
 
Hi

How can I return the full path of a template using VBA
and login name of windows XP using VBA?


Thanks

Jim Rech

The user name is returned like this:

MsgBox Environ("username")

If you create a new workbook from a template then there is no direct way to
find the path to the template from the new workbook.. If the template was
in the Templates folder this will return that path:
Application.TemplatesPath

--
Jim
"nc" wrote in message
...
| Hi
|
| How can I return the full path of a template using VBA
| and login name of windows XP using VBA?
|
|
| Thanks



nc

Hi Jim

Thanks a lot for your help.



-----Original Message-----
The user name is returned like this:

MsgBox Environ("username")

If you create a new workbook from a template then there

is no direct way to
find the path to the template from the new workbook..

If the template was
in the Templates folder this will return that path:
Application.TemplatesPath

--
Jim
"nc" wrote in

message
...
| Hi
|
| How can I return the full path of a template using VBA
| and login name of windows XP using VBA?
|
|
| Thanks


.



All times are GMT +1. The time now is 02:17 AM.

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