Relative Path to a Folder

G

Guest

I have a workbook containing a macro which combines the contents of several
workbooks that are in a sub-folder of the folder in which the combiner
resides. The macro uses the following code to identify the path to the
subfolder containing the workbooks to be combined:

Sub Filter_Data()
Get_File_Names _
MyPath:="C:\Documents and Settings\mtn1\Desktop\Test
Folder\Templates", _
Subfolders:=False, _
ExtStr:="*.xl*"

My problem is this: It's going to be on a network, and not all users will
have the same drive letter mapped. I have investigated relative paths, but
all the examples I've seen are paths to a specific filename in the target
folder. How can I tell the macro to look for workbooks in a subfolder of the
folder that contains the macro, without using that folder's absolute path?
 
G

Guest

Try this and change the 1.2.3.4 to your network IP
\\1.2.3.4\Documents and Settings\mtn1\Desktop\Test\Folder\Templates
 
G

Guest

Yep, I stumbled on this solution about two minutes after asking the question
lol...

Thanks to all for your help.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top