0

Program currently uses hard coded file paths and dbCurr with destinationptt as string. But would like to remove the hard coded file paths so program can run anywhere.

YowE3K
  • 23,852
  • 7
  • 26
  • 40
Joep82
  • 21
  • 7

1 Answers1

0

What you are looking for are relative paths. You can get the Path of your Project by:

CurrentProject.Path

You can than add some string like

CurrentProject.Path & "\folder\file.txt"

You also can go up a layer by using \..\

CurrentProject.Path & "\..\file.txt"

For more information take a look at these posts:

Access VBA - relative file references

Relative instead of Absolute paths in Excel VBA

sporc
  • 387
  • 1
  • 4
  • 14