Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom properties are missing in xls but do exist in xlsx #1410

Closed
codexp opened this issue Mar 6, 2020 · 2 comments
Closed

Custom properties are missing in xls but do exist in xlsx #1410

codexp opened this issue Mar 6, 2020 · 2 comments
Labels

Comments

@codexp
Copy link

codexp commented Mar 6, 2020

This is:

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

What is the expected behavior?

After setting custom properties, I find them in file's custom properties.

What is the current behavior?

This works for xlsx format, but doesn't for xls.

What are the steps to reproduce?

  • set custom properties
  • save as xls
  • open file in office
  • open custom properties dialog

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:

<?php

require __DIR__ . '/vendor/autoload.php';

// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();

$spreadsheet->getProperties()
    ->setCustomProperty('Exported', time(), \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_DATE)
    ->setCustomProperty('Version', '1.0')
;

$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xls($spreadsheet);
$writer->save('spreadsheet.xls');

Which versions of PhpSpreadsheet and PHP are affected?

1.8.2

@stale
Copy link

stale bot commented May 6, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@stale stale bot added the stale label May 6, 2020
@stale stale bot closed this as completed May 13, 2020
@IvanRibkov
Copy link

This bug is still present in PHP 7.4.33 + PhpSpreadsheet 1.28. Custom properties work fine for xlsx and ods formats but don't work for xls format. Tested on LibreOffice 6.4.7.2 and Microsoft Office 2003.

@oleibman oleibman mentioned this issue May 29, 2023
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants