Public Const on a Drive

From: MD (mdprosoft-client_at_ifrance.com)
Date: 07/15/04


Date: Thu, 15 Jul 2004 10:31:08 -0400

Good day all,

I have a series of excel files (all inter-linked) located in a folder called
"MasterFolder". Winthin that MasterFolder, I have other secondary folders
(Folder1, Folder2...).

Since all the files within these folders are all linked by macros, I use
Public Const to identify my directories instead of having to retype the full
path. (ie c:\MasterFolder\Folder1\... I would have a :
Public Const MainDrive = "C:\"
Public Const PCFolder = "MasterFolder\Folder1\" etc.).

So I could do things like open file MainDrive + PCFolder + "file.xls"
(c:\MasterFolder\Folder1\file.xls)

The thing is if I install this program on a drive other than the C: drive, I
have to go and modify my Public Const formula to fit the drive it is running
on.

So, Is there a way to formulate my path in a way that I won't declare the
drive but instead it will detect what drive the MfasterFolder is in and use
that drive as it's "drive" by default when my MainDrive constant is
declared.

Regards,

Michel



Relevant Pages

  • Re: create an acess report from multiple exel files
    ... Excel files have different names. ... If you have an Access .mdb file with links to each/all the spreadsheets, ... stored in folders by month order. ... At the end of the month, I need to make a report giving: ...
    (microsoft.public.access.reports)
  • Re: Can not open excel files without open application
    ... ~Anne Troy ... > I need help to open my Excel files in desktop, ... > folders. ... > try to open Excel in an other folder then it launch Microsoft Office ...
    (microsoft.public.excel.misc)
  • Can not open excel files without open application
    ... I need help to open my Excel files in desktop, ... folders. ... I have acces to my files only on application by FILE, ... try to open Excel in an other folder then it launch Microsoft Office 2000. ...
    (microsoft.public.excel.misc)
  • Re: macro to move from directory to directory
    ... The first code looked for the folder names in column A and the workbook names in ... > find the files in the folders. ... I did change the default location to save Excel files ...
    (microsoft.public.excel)