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

Error when opening xlsx file from OneDrive but not from other programs #667

Open
jordizg07 opened this issue Oct 31, 2023 · 1 comment
Open

Comments

@jordizg07
Copy link

Hello, I am trying to generate an xlsx file. When I generate it, I can open it with all software like LibreOffice Calc, but when I open it with OneDrive in Microsoft Office Excel, it gives me an error. I am using axlsx 2.0.1 and Ruby 2.7.1. Can someone help me?

The code I use (greatly simplified as a generic example) is this::

require 'axlsx'

Axlsx::Package.new do |p|
  p.use_shared_strings = true  # Asegúrate de que esta opción esté configurada
  p.use_autowidth = true  # Esta opción ajusta automáticamente el ancho de las columnas
  p.workbook.add_worksheet(name: 'Sheet1') do |sheet|
    sheet.add_row ['Name', 'Age', 'Gender']
    sheet.add_row ['name1', 'age1', 'gender1']
    sheet.add_row ['name2',' age2', 'gender2']
  end
  p.serialize('example.xlsx')
send_file 'example.xlsx'
end

@straydogstudio
Copy link
Contributor

@jordizg07 You'll want to use https://github.com/caxlsx/caxlsx instead, which is where all maintenance is happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants