Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

## [v0.11.12](https://github.com/JuliaData/XLSX.jl/tree/v0.11.11) - 2026-06-19
- add a package extension to support [FileIO.jl](https://github.com/JuliaIO/FileIO.jl)
- update copyright notice end-date

## [v0.11.11](https://github.com/JuliaData/XLSX.jl/tree/v0.11.11) - 2026-06-18
- Fix [#410](https://github.com/JuliaData/XLSX.jl/issues/410) by making `is_binary_path` case insensitive

## [v0.11.10](https://github.com/JuliaData/XLSX.jl/tree/v0.11.10) - 2026-05-28
- support macro-enabled files ([#401](https://github.com/JuliaData/XLSX.jl/issues/401))
- support pass-through of customXml files (again). ([#403](https://github.com/JuliaData/XLSX.jl/issues/403))
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018-2023 Felipe Noronha Tavares
Copyright (c) 2018-2026 Felipe Noronha Tavares
and other contributors:

https://github.com/juliadata/XLSX.jl/contributors
Expand Down
10 changes: 8 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "XLSX"
uuid = "fdbf4ff8-1666-58a4-91e7-1b58723a45e0"
license = "MIT"
version = "0.11.10"
version = "0.11.11"
authors = ["Felipe Noronha <felipenoris@gmail.com>"]
repo = "https://github.com/juliadata/XLSX.jl.git"

Expand All @@ -19,16 +19,20 @@ XML = "72c71f33-b9b6-44de-8c94-c961784809e2"
ZipArchives = "49080126-0e18-4c2a-b176-c102e4b3760c"

[weakdeps]
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
StyledStrings = "f489334b-da3d-4c2e-b8f0-e476e12c162b"

[extensions]
FileIOExt = "FileIO"
StyledStringsSstsExt = "StyledStrings"

[compat]
CSV = "0.10.15"
Colors = "0.12, 0.13"
Distributions = "0.25.0"
FileIO = "1"
OrderedCollections = "1"
Pkg = "1"
PrecompileTools = "1"
StyledStrings = "1.0.3"
Tables = "1"
Expand All @@ -41,9 +45,11 @@ julia = "1.8"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StyledStrings = "f489334b-da3d-4c2e-b8f0-e476e12c162b"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["CSV", "DataFrames", "Distributions", "Random", "StyledStrings", "Test"]
test = ["CSV", "DataFrames", "Distributions", "FileIO", "Pkg", "Random", "StyledStrings", "Test"]
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,7 @@ and send a Pull Request.

## Alternative Packages

* [ExcelFiles.jl](https://github.com/davidanthoff/ExcelFiles.jl)

* [FileIO.jl](https://github.com/JuliaIO/FileIO.jl)

* [LibXLSXWriter.jl](https://github.com/jaakkor2/LibXLSXWriter.jl)

* [Taro.jl](https://github.com/aviks/Taro.jl)

* [XLSXReader.jl](https://github.com/mpastell/XLSXReader.jl)
5 changes: 4 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ makedocs(
modules = [ XLSX ],
pages = [
"Home" => "index.md",
"Tutorial" => "tutorial.md",
"Tutorial" => Any[
"Using XLSX" => "tutorial/XLSXtutorial.md",
"Using FileIO" => "tutorial/FileIOtutorial.md",
],
"Formatting Guide" => Any[
"Cell formats" => "formatting/cellFormatting.md",
"Conditional formats" => "formatting/conditionalFormatting.md",
Expand Down
12 changes: 12 additions & 0 deletions docs/src/api/files.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ XLSX.writexlsx
XLSX.savexlsx
```

## Files (using FileIO)

!!! note

These functions extend `FileIO.load` and `FileIO.save`. Call them as
`FileIO.load(...)` and `FileIO.save(...)` after doing `using FileIO`.

```@docs
XLSX.load
XLSX.save
```

## Worksheets

```@docs
Expand Down
138 changes: 138 additions & 0 deletions docs/src/tutorial/FileIOtutorial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# FileIO Tutorial

## Introduction

A package extension to XLSX.jl provides support for Excel files
under the [FileIO.jl](https://github.com/JuliaIO/FileIO.jl) package.

[FileIO.jl](https://github.com/JuliaIO/FileIO.jl) aims to provide a common
framework for detecting file formats and dispatching to appropriate readers/writers.

Through [FileIO.jl](https://github.com/JuliaIO/FileIO.jl), you can read
simple tabular data from an Excel (.xlsx) file and save tabular data
to an Excel file using simple `load` and `save` functions without needing
to know anything about XLSX.jl itself.

XLSX.jl provides much more extensive functionality if you need it.
Check out the rest of the documentation for full details.

## Setup

First, make sure you have the **FileIO.jl** and **XLSX.jl** packages installed.

```julia
julia> using Pkg

julia> Pkg.add(["FileIO", "XLSX"])
```

## Usage

### Load an Excel file

To read an Excel file into a `DataFrame`, use the following julia code:

```julia
using FileIO, DataFrames

df = DataFrame(load("data.xlsx", "Sheet1"))
```

The call to `load` returns an object that is a [Tables.jl](https://github.com/JuliaData/Tables.jl) table,
so it can be passed to any function that can handle Tables.jl tables. Here are some examples of
materializing an Excel file into such data structures:

```julia
using FileIO, DataFrames, PrettyTables

# Load into a DataFrame
julia> DataFrame(load("HTable.xlsx"))
5×10 DataFrame
Row │ Year 1940 1950 1960 1970 1980 1990 2000 2010 2020
│ String Any Any Float64 Float64 Any Any Float64 Float64 Float64
─────┼───────────────────────────────────────────────────────────────────────────────────────────
1 │ Col A 1 2 3.0 4.0 5 6 7.0 8.0 9.0
2 │ Col B 10 20 30.0 40.0 50 60 70.0 80.0 90.0
3 │ Col C 100 200 300.0 400.0 500 600 700.0 800.0 900.0
4 │ Col D 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
5 │ Col E Hello 2025-12-19 3.0 3.33 Hello 2025-12-19 3.0 3.33 1.0

julia> DataFrame(load("HTable.xlsx"; transpose=true))
9×6 DataFrame
Row │ Year Col A Col B Col C Col D Col E
│ Int64 Int64 Int64 Int64 Float64 Any
─────┼─────────────────────────────────────────────────
1 │ 1940 1 10 100 0.1 Hello
2 │ 1950 2 20 200 0.2 2025-12-19
3 │ 1960 3 30 300 0.3 3
4 │ 1970 4 40 400 0.4 3.33
5 │ 1980 5 50 500 0.5 Hello
6 │ 1990 6 60 600 0.6 2025-12-19
7 │ 2000 7 70 700 0.7 3
8 │ 2010 8 80 800 0.8 3.33
9 │ 2020 9 90 900 0.9 true


# Load into a PrettyTable
julia> PrettyTable(load("HTable.xlsx"))
┌───────┬───────┬────────────┬───────┬───────┬───────┬────────────┬───────┬───────┬───────┐
│ Year │ 1940 │ 1950 │ 1960 │ 1970 │ 1980 │ 1990 │ 2000 │ 2010 │ 2020 │
├───────┼───────┼────────────┼───────┼───────┼───────┼────────────┼───────┼───────┼───────┤
│ Col A │ 1 │ 2 │ 3.0 │ 4.0 │ 5 │ 6 │ 7.0 │ 8.0 │ 9.0 │
│ Col B │ 10 │ 20 │ 30.0 │ 40.0 │ 50 │ 60 │ 70.0 │ 80.0 │ 90.0 │
│ Col C │ 100 │ 200 │ 300.0 │ 400.0 │ 500 │ 600 │ 700.0 │ 800.0 │ 900.0 │
│ Col D │ 0.1 │ 0.2 │ 0.3 │ 0.4 │ 0.5 │ 0.6 │ 0.7 │ 0.8 │ 0.9 │
│ Col E │ Hello │ 2025-12-19 │ 3.0 │ 3.33 │ Hello │ 2025-12-19 │ 3.0 │ 3.33 │ 1.0 │
└───────┴───────┴────────────┴───────┴───────┴───────┴────────────┴───────┴───────┴───────┘

julia> PrettyTable(load("HTable.xlsx"; transpose=true))
┌──────┬───────┬───────┬───────┬───────┬────────────┐
│ Year │ Col A │ Col B │ Col C │ Col D │ Col E │
├──────┼───────┼───────┼───────┼───────┼────────────┤
│ 1940 │ 1 │ 10 │ 100 │ 0.1 │ Hello │
│ 1950 │ 2 │ 20 │ 200 │ 0.2 │ 2025-12-19 │
│ 1960 │ 3 │ 30 │ 300 │ 0.3 │ 3 │
│ 1970 │ 4 │ 40 │ 400 │ 0.4 │ 3.33 │
│ 1980 │ 5 │ 50 │ 500 │ 0.5 │ Hello │
│ 1990 │ 6 │ 60 │ 600 │ 0.6 │ 2025-12-19 │
│ 2000 │ 7 │ 70 │ 700 │ 0.7 │ 3 │
│ 2010 │ 8 │ 80 │ 800 │ 0.8 │ 3.33 │
│ 2020 │ 9 │ 90 │ 900 │ 0.9 │ true │
└──────┴───────┴───────┴───────┴───────┴────────────┘

```

For more information, see [`XLSX.load`](@ref)

### Save an Excel file

The following code saves any Tables.jl table (such as a `DataFrame`) as an Excel file:

```julia
using FileIO

save("output.xlsx", myTable)
```

For more information, see [`XLSX.save`](@ref)

### Using the pipe syntax

The `load` and `save` functions also support the pipe syntax. For example, to load an
Excel file into a `DataFrame`, one can use the following code:

```julia
using FileIO, DataFrame

df = load("data.xlsx", "Sheet1") |> DataFrame
```

To save any Tables.jl compatible table (such as a DataFrame), one can use the following form:

```julia
using FileIO, DataFrame

df = # Aquire a DataFrame somehow

df |> save("output.xlsx")
```
4 changes: 2 additions & 2 deletions docs/src/tutorial.md → docs/src/tutorial/XLSXtutorial.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

# Tutorial
# XLSX Tutorial

## Setup

First, make sure you have **XLSX.jl** package installed.
First, make sure you have the **XLSX.jl** package installed.

```julia
julia> using Pkg
Expand Down
41 changes: 41 additions & 0 deletions ext/FileIOExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module FileIOExt
# Provides hooks for FileIO.jl to save and load XLSX files.

using FileIO

using XLSX

import XLSX: load, save

function load(f::File{FileIO.format"Excel"}; transpose::Bool=false, kw...)
filename = FileIO.filename(f)
if transpose
return XLSX.readtransposedtable(filename; kw...)
else
return XLSX.readtable(filename; kw...)
end
end

function load(f::File{FileIO.format"Excel"}, sheet; transpose::Bool=false, kw...)
filename = FileIO.filename(f)
if transpose
return XLSX.readtransposedtable(filename, sheet; kw...)
else
return XLSX.readtable(filename, sheet; kw...)
end
end

function load(f::File{FileIO.format"Excel"}, sheet, rows_or_columns; transpose::Bool=false, kw...)
filename = FileIO.filename(f)
if transpose
return XLSX.readtransposedtable(filename, sheet, rows_or_columns; kw...)
else
return XLSX.readtable(filename, sheet, rows_or_columns; kw...)
end
end

function save(f::File{FileIO.format"Excel"}, data; kw...)
XLSX.writetable(FileIO.filename(f), data; kw...)
end

end # module
1 change: 1 addition & 0 deletions src/XLSX.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ include("images.jl")
include("write.jl")
include("fileArray.jl")


PCT.@setup_workload begin
# Putting some things in `@setup_workload` instead of `@compile_workload` can reduce the size of the
# precompile file and potentially make loading faster.
Expand Down
1 change: 1 addition & 0 deletions src/images.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ If multiple, overlapping images are added, newer images overly older ones.
# Arguments

`s::Worksheet`: the target worksheet.

`ref::AbstractString`: Either a valid cell reference (e.g. `"A1"`) or a valid cell range (e.g. `"B2:D4"`).
The image will be anchored to the top left of the reference and sized to fit within the reference bounds.
If a cell range is given, the `size` keyword argument is ignored.
Expand Down
Loading
Loading