Back

Laravel-Excel: Change sheet name and add as an external


Anıl Sarpkaya posted 1 week ago

I got 2 excel files lets say A and B. I want to copy a sheet from A to B more then one time. And I got an error "Rename external sheet first.". But when I try to change the name of the sheet before copy then add it to B, I got this error "Sheet does not exist.". I dont know whats wrong with it.

        $sheet_original->setTitle("SHEET".$i);
        $sheets[$i] = $sheet_original;
        $sheets[$i]->cell('I64', function($cell) use($i) { $cell->setValue($i); });
        $excel->addExternalSheet($sheets[$i] );

Sign in to participate in this thread!



We'd like to thank these amazing companies for supporting us