Forum Discussion
Extract Data with VBA in the Project
Hi Tulio.
By way of visual reports, I don't think it's possible to export custom fields, not even by saving the database, at least I never managed to do it after many attempts, even though it's shown as an eligible option.
In a quick way, you can copy and paste the task table into Excel: Select the entire table with Ctrl+Shift+Space, or click on the top left corner of the table, and then Ctrl+C to copy and paste into an Excel sheet later. Obviously the custom fields must be included in the Project task table.
Another option is to export the selected fields to Excel, including the custom ones, through the Wizard that is shown in Save As, choosing Type Excel Workbook...
You can also create a simple macro (VBA) that exports fields, including the custom fields. There are many examples on the Internet.
In any of these options, you should not have limitations on the size of the data to export, unless it is an immensely large file, which does not seem to be the case that you show, or you have limitations on your devices.
I hope this information helps you.
Ignacio
- TulioOliveiraDec 19, 2024Copper Contributor
Thanks Ignacio_Martin, but this way it wouldn't help me copying (CTRL + C) and pasting into Excel. As I said before, I'm doing the extraction in a structured way by exporting to an Access database model available within Project. It already brings me all the structured tables, including some tables with granularity (days, weeks, months). However, as the schedule grows, it no longer allows exporting. I tried using VBA, but the method I used didn't export the "CubeDynamicCustomFieldTask" table, which is responsible for the custom fields.
In addition, the export of the MSP_EpmTaskByDay table already exceeds 1 million rows due to the weekly granularity.
- John-projectDec 19, 2024Silver Contributor
TulioOliveira,
You can export any type of Project data to Excel (or Access) with VBA but it would have to be per task, resource and/or assignment instead of "en-masse" as a cube. I've written many macros that export all kinds of Project data to Excel.
Just curious, what Project fields are you trying to export?
John
- TulioOliveiraDec 23, 2024Copper Contributor
Hy John.
Thanks for written me. I want extract some fields Text and Duration. Total of 7 field custom. My model of data is granulated of weeks. If I extract for .XLSX, I loss it's granulated. The extraction for Excel, don't export this granulated, only .mdb.
Do you have some VBA code to share with me?