Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

Pull Filename/Filepath when extracting to excel

$
0
0

Hey All,

 I have a macro that extracts data from my project into an excel file with just the Task UID, Resource Names, and a few other things and I use it to integrate with COBRA. 

However I only helped with this macro I noticed that the user always has to change the file name of the Project .mpp file and has to re-enter in a filename each time. I was curious how I can have VBA just pull that information and add it to the saved name of the excel file. Here is how the macro starts

Const FILEPATH As String = "" 'replace with your filepath'
    Const FILENAME As String = ""  'replace with your filename


At the Bottom of the macro we have this:

xlBook.SaveAs FILENAME:=FILEPATH & FILENAME, FileFormat:=xlCSV

(Which is why the filepath and filename are required)

How can I stop the need for user entry? And just have whatever activeproject running the Macro automatically insert its file-path and filename. 

Thank you for any help!


Viewing all articles
Browse latest Browse all 5347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>