Skip to content

Incorrect result from execution of InsertRow with INSERT_AFTER #156

@AnatolBazyukin

Description

@AnatolBazyukin

SET DEFAULT TO D:\Test_err
#INCLUDE "vfpxworkbookxlsx.h"
LOCAL lcFile, lnWb, lcOutPath
lcFile = GETFILE("xlsx", "Workbook", "Load", 0, "Select Workbook to load into Class")
IF !EMPTY(lcFile)
lcOutPath = ADDBS(JUSTPATH(lcFile))
goExcel = NEWOBJECT("VFPxWorkbookXLSX", "VFPxWorkbookXLSX.vcx", "", 1251) && Set codepage 1250
lnWb = goExcel.OpenXlsxWorkbook(lcFile)
goExcel.InsertRow(lnWB, 1, 3, INSERT_AFTER, 3)
goExcel.InsertRow(lnWB, 1, 1, INSERT_BEFORE,2)
goExcel.SaveWorkbookAs(lnWb, lcOutPath + JUSTSTEM(lcFile) + "_2.xlsx")
ENDIF

After executing the operator goExcel.InsertRow(lnWB, 1, 3, INSERT_AFTER, 3), rows 4 and 5 are deleted.

test.xlsx
TEST_2.xlsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions