ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Opening Files - Marcro (https://www.excelbanter.com/excel-programming/437235-opening-files-marcro.html)

Max2073

Opening Files - Marcro
 
Help Needed.

I had developed a macro that was used by myself, however now the macro needs
to be utilised by others.

The marco opens files, that have been exported from the corporate database.
The files are saved automatically to the users C Drive eg. C:\Documents and
Settings\"username €“ officer logged on"\help.xls

The only difference is the username in the file path.

Is there anyway that I can change the file path to automatically go to the
correct location and file, without having to create a different macro for
each user.

Any help would be greatly appreciated.


Gary Keramidas

Opening Files - Marcro
 
try environ("userprofile")

type ?environ("userprofile")

in the immediate window to see the results


--


Gary Keramidas
Excel 2003


"Max2073" wrote in message
...
Help Needed.

I had developed a macro that was used by myself, however now the macro needs
to be utilised by others.

The marco opens files, that have been exported from the corporate database.
The files are saved automatically to the users C Drive eg. C:\Documents and
Settings\"username €“ officer logged on"\help.xls

The only difference is the username in the file path.

Is there anyway that I can change the file path to automatically go to the
correct location and file, without having to create a different macro for
each user.

Any help would be greatly appreciated.




All times are GMT +1. The time now is 09:08 AM.

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