ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to get a DriveName without using the FileSystemObjects? (https://www.excelbanter.com/excel-programming/382804-how-get-drivename-without-using-filesystemobjects.html)

Kai Uwe Schmidt

How to get a DriveName without using the FileSystemObjects?
 
Hi all,

for n upcoming rollout, i have a problem .

An Excel-file is to be distributed to various servers.
On all servers exists a special folder (\datafolder eg) with a fixed
name.The distributed file should include
an external link to those folders and get data from flatfiles (identically
named) located on them. So for building the
link, name and folder of the local source file are identical, fixed and
sure.

The problem for building the external link is:
the server names and the drive names do differ. How can i get them ?

Perhaps it is possible to extraxt from ActiveWorkbook.Path, but i cannot
find how.

It´s not possible to use the methods of the FileScripting-Library
(FileSystemObject), since it is not granted
that this library is available.

Thanks for any (desperately needed) help in advance!

Kai
Cologne Germany




Juan Pablo González

How to get a DriveName without using the FileSystemObjects?
 
Are you interested in the letter of the drive ? like E: or similar ? You
could just do

driveLetter = Left$(ActiveWorkbook.Path, 1)

but I may be missing part of your point.

--
Regards,

Juan Pablo González

"Kai Uwe Schmidt" wrote in message
...
Hi all,

for n upcoming rollout, i have a problem .

An Excel-file is to be distributed to various servers.
On all servers exists a special folder (\datafolder eg) with a fixed
name.The distributed file should include
an external link to those folders and get data from flatfiles (identically
named) located on them. So for building the
link, name and folder of the local source file are identical, fixed and
sure.

The problem for building the external link is:
the server names and the drive names do differ. How can i get them ?

Perhaps it is possible to extraxt from ActiveWorkbook.Path, but i cannot
find how.

It´s not possible to use the methods of the FileScripting-Library
(FileSystemObject), since it is not granted
that this library is available.

Thanks for any (desperately needed) help in advance!

Kai
Cologne Germany







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

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