Skip to content

When RemoveRow use, cells are unmerged #4116

Answered by oleibman
hiroto-nagaoka asked this question in Q&A
Discussion options

You must be logged in to vote

I am not able to duplicate your problem from your description. I tried the following program:

        $spreadsheet = new Spreadsheet();
        $sheet = $spreadsheet->getActiveSheet();
        $sheet->getCell('A1')->setValue(1);
        $sheet->getCell('A2')->setValue('hello');
        $sheet->getCell('D2')->setValue(2);
        $mergeRange = 'A2:C2';
        $sheet->mergeCells($mergeRange);
        $sheet->removeRow(1);
        $writer = new XlsxWriter($spreadsheet);
        $outfile = 'issue.4116.xlsx';
        $writer->save($outfile);
        echo "saved $outfile\n";

When I open the saved spreadsheet, the first row has been removed, and the cells remain merged in the new first row.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hiroto-nagaoka
Comment options

Answer selected by hiroto-nagaoka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants