Skip to content

Unable to carry forward MS excel Theme colors #2387

Closed
@DeekshaPrabhub96

Description

This is: I have an excel with text in standard colours and theme colours, Standard colours are working fine on save but theme colours are converted to black on save.

Using PHPSpreadsheet I. am just opening and saving the file with different name.

- [ ] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

The text with themed colours are saved as it is in the new file.

What is the current behavior?

In the new file Theme Coloured Text are converted to Black Colour text. (Even White colour text gets converted. For some reason Excel considers white as Theme colour)

What are the steps to reproduce?

Create an Excel with text in Theme colour and some cells with text in standard colours, Open this file using PHPSpreadsheet and save it with different file name.

Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:

// Create new Spreadsheet object
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();

// add code that show the issue here...

$spreadsheet = $reader->load($file);

$writer = new Xlsx($spreadsheet);
$writer->save('TextColorOutput.xlsx');
TextColorInput.xlsx
TextColorOutput.xlsx
Screenshot 2021-11-10 at 12 16 55 PM

Which versions of PhpSpreadsheet and PHP are affected?

1.19

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions