Getting the filepath of macro project

Getting the filepath of macro project

sunchuanpu
Enthusiast Enthusiast
817 Views
2 Replies
Message 1 of 3

Getting the filepath of macro project

sunchuanpu
Enthusiast
Enthusiast

Hello,

I have some txt files for storing some editable settings (such as user's list of stylesheet for printing), in the same folder as my .dvb file

I realized that the path of those txt files can be different if I want to use the program on other computers. Is it possible to get the filepath of current .dvb file? It will be best if I don't have to preset a specific location and ask my users to put the folder there.

Or are there better ways to store information?

 

Thank you very much.

 

 

0 Likes
Accepted solutions (1)
818 Views
2 Replies
  • VBA
Replies (2)
Message 2 of 3

Ed__Jobe
Mentor
Mentor
Accepted solution

You can reference "Visual Basic for Applications Extensibility 5.3". Then you can use

VBE.ActiveProject.FileName

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 3 of 3

sunchuanpu
Enthusiast
Enthusiast

Thank you very much.

 

I found this code works for me

Application.VBE.ActiveVBProject.fileName

 

0 Likes