Skip to content

glexey/excel2img

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

excel2img

Save ranges from Excel documents as images

Requirements

  1. Python 2.7, 3.3 or later
  2. pywin32
  3. Pillow >= 3.3.1
  4. Microsoft Excel (tested with Office 2013, on Windows 10)

Installation

pip install excel2img

Usage as python module

import excel2img

# Save as PNG the range of used cells in test.xlsx on page named "Sheet1"
excel2img.export_img("test.xlsx", "test.png", "Sheet1", None)

# Save as BMP the range B2:C15 in test.xlsx on page named "Sheet2"
excel2img.export_img("test.xlsx", "test.bmp", "", "Sheet2!B2:C15")

# Save as GIF the range "MyNamedRange"
excel2img.export_img("test.xlsx", "test.gif", "", "MyNamedRange")

Usage from command line

# Save as PNG the range of used cells in test.xlsx on first page
python excel2img.py test.xlsx test.png

# Save as PNG the range of used cells in test.xlsx on page "Sheet2"
python excel2img.py test.xlsx test.png -p Sheet2

# Save as PNG the range "MyNamedRange"
python excel2img.py test.xlsx test.png -r MyNamedRange

# More range syntax examples
python excel2img.py test.xlsx test.gif -r 'Sheet3!B5:C8'
python excel2img.py test.xlsx test.bmp -r 'Sheet4!SheetScopedNamedRange'

Author

Alexey Gaydyukov <glexey@gmail.com>

License

Apache License 2.0

Credits

Inspired by visio2img

About

Save ranges from Excel documents as images

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages