I would like to open a file that is stored in the same directory as the macro I am running. Is there a property or function that would return the directory path to me?
I.E. something similar to MS Access's CurrentProject.Path property.
I'm not a pro, but it seems like when I write my VBA macro's if I want it to open a file in the same directory I just tell it to open the file without a path to it. Then it goes to the directory that the macro was launched from. But that is VBA for MS office. I don't know if that is any help or not.
You can check VBA.FileSystem.CurDir$ for the current directory, but this will always be \Accpac\Runtime when you launch a macro.
There is no .Path property for VBA macros though, so you need to pick a folder and hardcode it, or use something like AccpacSession.SharedDataPathOnServer & "\Macros" to place your macros and the supporting files.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.