Open Source Ruby API for Excel Spreadsheet Processing
Free Ruby Library working with Excel XLSX file formats. It supports speedy parsing of XLSX file formats, generating a new workbook, reading existing XLSX files & so on.
What is rubyXL Library?
When seeking a powerful, open source Ruby Excel Library for handling modern spreadsheet files, rubyXL presents an efficient and cost-effective solution. As a versatile, free Ruby Excel Library distributed under the MIT license, it empowers developers to seamlessly parse Excel Spreadsheet files with remarkable speed, fully interpreting the OOXML structure. Beyond just reading data, you can easily modify Excel XLSX file via Ruby, accessing specific rows, columns, and cell properties for granular control. This capability makes it an ideal tool for applications that need to interrogate and manipulate existing workbooks programmatically.
The library extends its utility far beyond parsing, offering robust tools to create Excel XLSX Spreadsheet files from the ground up and deeply customize Excel XLSX content. Key functions include the ability to generate new workbooks, add new worksheets, and rename existing ones. Developers can fully customize Excel XLSX formatting by changing cell styles, applying enhanced borders, and merging cells. Furthermore, managing workbook structure is straightforward, allowing you to insert or delete rows and columns as needed. With rubyXL, you gain a comprehensive, open-source toolkit for both reading from and writing to XLSX files directly within your Ruby environment.
Getting Started with rubyXL
The recommend way to install rubyXL library is by using RubyGems. Please use the following command for smooth installation.
Install rubyX via RubyGems
gem install rubyXL Generate New Excel Workbook via Ruby
Microsoft Excel is a powerful tool that gives users the ability to organize and store their data in a better way. It is the most used spreadsheet program and plays an important role in many business activities, education tasks as well as individual data organization. The rubyXL library gives software programmers the capability to generate a new Excel workbook with just a couple of lines of code. You can easily add a new worksheet, assign a name to the worksheet, delete the unwanted worksheet, and much more.
How to Create Excel Workbook via Ruby API?
require 'rubyXL'
wb = RubyXL::Workbook.new
wb.is_template = true
ws = wb[0]
ws.add_cell(0, 0, 'test')
wb.save('output.xltx')
Manage Columns and Rows via Ruby
The open source rubyXL library has included several important features related to managing rows and columns inside an Excel spreadsheet. The library has provided support for inserting new rows or columns, changing row height, modifying column width, changing fonts inside a row or column, changing alignment, deleting a set of rows or columns, modifying cells format, and so on
Access & Modify Existing Spreadsheets
The open source rubyXL gives software developers the capability to access and open already created spreadsheets using Ruby code. You can easily access a particular row and read its content and modify it according to your own needs. The library also provides support for adding new worksheets, images, and text with just a couple of lines of Ruby code. You can also select change cells, borders, fill, merge cells, and so on.
How to Access & Rename Worksheets via Ruby Library
workbook.worksheets[0] # Returns first worksheet
workbook[0] # Returns first worksheet
workbook['Sheet1']
//Renaming Worksheets
worksheet.sheet_name = 'Cool New Name' # Note that sheet name is limited to 31 characters by Excel.
Read Existing Excel File via Ruby
The free rubyXL library enables software developers to open and read existing Excel spreadsheet documents inside their own application using a couple of Ruby commands. The library has provided some useful functions to access and iterate through different rows and columns with ease.
How to Read Excel File via Ruby API?
//Replace 'ExcelFilePath' with the file path to read file
workbook = RubyXL::Parser.parse('ExcelFilePath')