Lee
Lee

Reputation: 41

EPPlus Table @ Column reference

I'm trying to use EPPlus to create a table on a worksheet. I can create the table, but all my @ variables become #Ref! when opening up the file. If I paste the exact same formula into Excel it takes it and has no problem. What am I missing here? Do I need to apply the table somehow after creating it? Thanks, Lee

private void ProcessVehicleData(BorrowingBase bbData, ExcelWorksheet ew, int colStart, int rowStart) {
    int origFirstRow = rowStart;
    foreach (DailyCAPS data in bbData.DailyCAPS) {
        FillRow(ew, data, colStart, rowStart);
        ++rowStart;
    }

    try {
        ExcelAddressBase eab = new ExcelAddressBase(origFirstRow - 1, ExcelColumnNameToNumber("A"), rowStart - 1, ExcelColumnNameToNumber("Y"));
        ExcelTable et = ew.Tables.Add(eab, "VehicleData");

        if (origFirstRow != rowStart) {
            ew.Cells[origFirstRow, ExcelColumnNameToNumber("Y")].Formula = "=IF([@Inventory Days]>210,\"H\",IF([@TitleApp]+[@UtahTitleReceived]=0,\"B\",\"\"))";
        }
    }
    catch { }
}

Upvotes: 1

Views: 779

Answers (2)

Lee
Lee

Reputation: 41

See comments for answer...github.com/JanKallman/EPPlus/issues/521

Upvotes: 2

Wei Lin
Wei Lin

Reputation: 3811

No,epplus can't do it.
Because epplus Tables.Add is only pure data fill not workbook query,so =[@XXX] is not work.

Upvotes: 0

Related Questions