Results 1 to 5 of 5

Changing An Absolute Path To A Relative Path

Threaded View

elgourmet Changing An Absolute Path To... 08-03-2010, 04:42 AM
Andrew-R Re: Changin An Absolute Path... 08-03-2010, 04:49 AM
elgourmet Re: Changin An Absolute Path... 08-03-2010, 05:05 AM
Andrew-R Re: Changin An Absolute Path... 08-03-2010, 05:11 AM
elgourmet Re: Changin An Absolute Path... 08-03-2010, 05:21 AM
  1. #1
    Registered User
    Join Date
    07-19-2010
    Location
    Austria
    MS-Off Ver
    Excel 2003
    Posts
    20

    Arrow Changing An Absolute Path To A Relative Path

    hello

    i am running a VBA script which updates cells of all files in a given folder:
       Dim myPath As String
       Dim objFso As Object
       Dim myFolder As Object, myFile   As Object
       myPath = Range("A19") 
       Set myFolder = objFso.GetFolder(myPath).Files
       For Each myFile In myFolder
          Set wb = Workbooks.Open(myFile)
    in A19, i am defining the path: i.e. C:\Documents\Files\Test

    however, this is an absolute path. let's say, the document which executes the macro is located in "Files", i just want to write "\Test", instead of entering the whole absolute path. Or let's say i want to update the cells in the folder above, i would like to write "..\"

    does anyone have some hints or tips on how to achieve this?
    any help would be very very much appreciated!
    Last edited by elgourmet; 08-03-2010 at 05:35 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1