Export project, and add all non-empty rows into Excel table



  • When I export a Microsoft Project file into Excel using the export tool, the resulting XLSX file has 1 table called Task_Table1. Unfortunately that table only includes the header row. Is there any way to automate adding all non-empty rows into that table, or alternatively making Project include all the lines in the table it creates when exporting? I'm open to all options, including Excel script and power automate.

    Background: I'm trying to feed the exported Excel into a Power Automate flow, but I need it to have a proper table in order to use the "get rows in table" step.



  • No solution so far from the community, so I did it dirty by running this script on the newly generated XLSX file:

    function main(workbook: ExcelScript.Workbook) {
        let selectedSheet = workbook.getWorksheets()[0];
        let tablearr = selectedSheet.getTables();
    
    tablearr.forEach((currtable) => {
        currtable.convertToRange();
    });
    
    let newTable = workbook.addTable(selectedSheet.getRange("A1: O1").getExtendedRange(ExcelScript.KeyboardDirection.down), true);
    
    newTable.setName("Gant1");
    

    }

    Edit the column range according to your own solution




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2