RamblingCookieMonster / Psexcel

Licence: mit
A simple Excel PowerShell module

Programming Languages

powershell
5483 projects

Projects that are alternatives of or similar to Psexcel

X Spreadsheet
A web-based JavaScript(canvas) spreadsheet
Stars: ✭ 12,046 (+5047.86%)
Mutual labels:  excel, spreadsheet
Seatable
SeaTable: easy like a spreadsheet, powerful like a database
Stars: ✭ 231 (-1.28%)
Mutual labels:  excel, spreadsheet
Tui.grid
🍞🔡 The Powerful Component to Display and Edit Data. Experience the Ultimate Data Transformer!
Stars: ✭ 1,859 (+694.44%)
Mutual labels:  excel, spreadsheet
Functional Data Grid
Data grids in functional style with ReactJS
Stars: ✭ 125 (-46.58%)
Mutual labels:  excel, spreadsheet
Yarg
Yet Another Report Generator - CUBA Platform reporting engine
Stars: ✭ 215 (-8.12%)
Mutual labels:  excel, reporting
Jxls
Java library for creating Excel reports using Excel templates
Stars: ✭ 128 (-45.3%)
Mutual labels:  excel, reporting
Test files
📚 SheetJS Test Files (XLS/XLSX/XLSB and other spreadsheet formats)
Stars: ✭ 150 (-35.9%)
Mutual labels:  excel, spreadsheet
Jupyterlab Spreadsheet
JupyterLab plugin for viewing spreadsheets, such as Excel .xls/.xlsx workbooks and OpenOffice .ods files
Stars: ✭ 95 (-59.4%)
Mutual labels:  excel, spreadsheet
Documentserver
ONLYOFFICE Document Server is an online office suite comprising viewers and editors for texts, spreadsheets and presentations, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
Stars: ✭ 2,335 (+897.86%)
Mutual labels:  excel, spreadsheet
Xlwings
xlwings is a BSD-licensed Python library that makes it easy to call Python from Excel and vice versa. It works with Microsoft Excel on Windows and macOS.
Stars: ✭ 2,181 (+832.05%)
Mutual labels:  excel, reporting
Excel to code
Roughly translate some Excel spreadsheets to Ruby or C.
Stars: ✭ 214 (-8.55%)
Mutual labels:  excel, spreadsheet
Calx.js
jQuery Calx - a jQuery plugin for creating formula-based calculation form
Stars: ✭ 190 (-18.8%)
Mutual labels:  excel, spreadsheet
Hot Table
Handsontable - Best Data Grid Web Component with Spreadsheet Look and Feel.
Stars: ✭ 114 (-51.28%)
Mutual labels:  excel, spreadsheet
Xlsx
Fast and reliable way to work with Microsoft Excel™ [xlsx] files in Golang
Stars: ✭ 132 (-43.59%)
Mutual labels:  excel, spreadsheet
Phpspreadsheet
A pure PHP library for reading and writing spreadsheet files
Stars: ✭ 10,627 (+4441.45%)
Mutual labels:  excel, spreadsheet
Unpivotr
Unpivot complex and irregular data layouts in R
Stars: ✭ 148 (-36.75%)
Mutual labels:  excel, spreadsheet
Poi Android
📈 Apache POI for Android
Stars: ✭ 77 (-67.09%)
Mutual labels:  excel, spreadsheet
Dev Ref
Stars: ✭ 90 (-61.54%)
Mutual labels:  excel, spreadsheet
Yii2 Export
A library to export server/db data in various formats (e.g. excel, html, pdf, csv etc.)
Stars: ✭ 153 (-34.62%)
Mutual labels:  excel, spreadsheet
Angular Handsontable
Angular Data Grid with Spreadsheet Look & Feel. Official Angular wrapper for Handsontable.
Stars: ✭ 175 (-25.21%)
Mutual labels:  excel, spreadsheet

Build status

PSExcel

IMPORTANT: This project is no longer maintained. Please consider Doug's excellent ImportExcel example, which is frequently updated by Doug and the community.

This is a rudimentary PowerShell module for working with Excel via the EPPlus library, with no dependencies on Excel itself.

  • Thanks to Doug Finke for his ImportExcel example - hadn't seen EPPlus before this!
  • Thanks to Philip Thompson for his expansive module illustrating how to work with EPPlus in PowerShell
  • Thanks to the team and contributors behind EPPlus for a fantastic solution allowing .NET Excel interaction, without Excel.

Caveats:

  • This covers limited functionality; contributions to this function or additional functions would be welcome!
  • Minimal testing. Contributions welcome!
  • Naming conventions subject to change. Suggestions welcome!

Functionality

  • Export random PowerShell output to Excel spreadsheets
  • Import Excel spreadsheets to PowerShell as objects
  • No dependency on Excel being installed

Instructions

# One time setup
    # Download the repository
    # Unblock the zip
    # Extract the PSExcel folder to a module path (e.g. $env:USERPROFILE\Documents\WindowsPowerShell\Modules\)

    #Simple alternative, if you have PowerShell 5, or the PowerShellGet module:
        Install-Module PSExcel

# Import the module.
    Import-Module PSExcel    #Alternatively, Import-Module \\Path\To\PSExcel

# Get commands in the module
    Get-Command -Module PSExcel

# Get help for a command
    Get-Help Import-XLSX -Full

# Export data to an XLSX spreadsheet
    Get-ChildItem C:\ -File |
        Export-XLSX -Path C:\Files.xlsx

# Import data from an XLSX spreadsheet
    Import-XLSX -Path C:\Files.xlsx

Examples

Several examples are available on the accompanying blog post and the embedded Gist.

Some highlights:

Export and import data

#Create some demo data
    $DemoData = 1..10 | Foreach-Object{

        $EID = Get-Random -Minimum 1 -Maximum 1000
        $Date = (Get-Date).adddays(-$EID)

        New-Object -TypeName PSObject -Property @{
            Name = "jsmith$_"
            EmployeeID = $EID
            Date = $Date
        } | Select Name, EmployeeID, Date
    }

# Export it
    $DemoData | Export-XLSX -Path C:\temp\Demo.xlsx

# Import it back
    $Imported = Import-XLSX -Path C:\Temp\Demo.xlsx -Header samaccountname, EID, Date

Verify that it exported:

Excel

Check the data we imported back:

Imported data

Fun with formatting

Freeze panes:

# Open the previously created Excel file...
    $Excel = New-Excel -Path C:\temp\Demo.xlsx

# Get a Worksheet
    $Worksheet = $Excel | Get-Worksheet -Name Worksheet1

# Freeze the top row
    $Worksheet | Set-FreezePane -Row 2

# Save and close!
    $Excel | Close-Excel -Save

Freeze panes

Format the header:

# Re-open the file
    $Excel = New-Excel -Path C:\temp\Demo.xlsx

# Add bold, size 15 formatting to the header
    $Excel |
        Get-WorkSheet |
        Format-Cell -Header -Bold $True -Size 14

# Save and re-open the saved changes
    $Excel = $Excel | Save-Excel -Passthru

Header format

Format the first column:

#  Text was too large!  Set it to 11
    $Excel |
        Get-WorkSheet |
        Format-Cell -Header -Size 11

    $Excel |
        Get-WorkSheet |
        Format-Cell -StartColumn 1 -EndColumn 1 -Autofit -AutofitMinWidth -AutofitMaxWidth 7 -Color DarkRed

# Save and close
    $Excel | Save-Excel -Close

First column

Create tables

Why format the columns yourself? Create a table (thanks to awiddersheim!):

# Add a table, autofit the data.  We use force to overwrite our previous demo.
    $DemoData | Export-XLSX -Path C:\Temp\Demo.xlsx -Table -Autofit -Force

Table

Pivot tables and charts

This is straight from Doug Finke's fantastic ImportExcel module:

# Fun with pivot tables and charts! Props to Doug Finke
    Get-ChildItem $env:USERPROFILE -Recurse -File |
        Export-XLSX -Path C:\Temp\Files.xlsx -PivotRows Extension -PivotValues Length -ChartType Pie

Pivot

Notes

Note that while some of these examples leverage PowerShell version 3 or later language, the module itself should work with PowerShell 2, and all Pester tests run against both PowerShell 2 and PowerShell 4.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].