Giter Site home page Giter Site logo

excelerate's Introduction

Excelerate

This project aims to fix "broken" Excel files that load extremely slowly due to broken references. It does that by searching for broken references and removing them from the Excel file.

Running

This project is intended to be run on PowerShell Core. All plugins should ideally run on all OSes.

To run, load the PowerShell module (Import-Module excelerate.psd1) and run Repair-XLSX.

Repair-XLSX currently just has 2 required arguments, -InFile and -OutFile. InFile is the XLSX file which needs to be repaired. OutFile is the filename you want to save the repaired file as. Currently you cannot overwrite an existing file and any attempts to do so will result in an error.

Note that Repair-XLSX will support many options in the future and those options are hinted, but they will currently do nothing.

Building

This project may be built using make. To build, simply run make then make test to run the Pester tests.

For ease of testing, you may also run make shell to dump you into a shell with the module imported.

Installing

Note that make install is NOT currently implemented. Installation is currently manual. In the future we will try to implement make install.

To install, copy all the files in the "build" directory into a new folder in your PowerShell modules directory.

Public functions

The following functions are publicly exported from this module for use. These functions may be used either manually, or in automated jobs.

  • Repair-XLSX This function will attempt to repair an XLSX file by removing broken references

excelerate's People

Contributors

hobadee avatar

Watchers

 avatar

excelerate's Issues

[BUG] null-valued expression

Describe the bug
Some Excel files will throw the following error:
InvalidOperation: You cannot call a method on a null-valued expression.

Investigate and resolve.

My initial guess is that there are either no DefinedNames, or ExternalReferences, and so it's a null array which is throwing the error.

[REQUEST] Remove ActiveX

Is your feature request related to a problem? Please describe.
Allow removal of ActiveX components from a file

Describe the solution you'd like
ActiveX components should be removable from a file via command line argument

[REQUEST] Remove VBA

Is your feature request related to a problem? Please describe.
Allow removal of VBA scripts from a file

Describe the solution you'd like
There should be a command-line option to remove VBA scripts from a given file

[REQUEST] Minimize XML

Describe the solution you'd like
XML should be minimized to:

  1. Minimize the file size
  2. Prevent potential CR/LF issues between OSes

[BUG] Excel complains on first open

Describe the bug
Excel will complain about the file being "corrupted" on first open. While it fixes the issues, it is still annoying. Find the root cause and resolve.

To Reproduce
Steps to reproduce the behavior:

  1. Repair an XLSX file
  2. Open with Microsoft Excel
  3. Excel will complain about the file being corrupt

Expected behavior
The file should open without Excel complaining about it being corrupt.

Screenshots
Screen Shot 2022-04-27 at 16 45 37
Screen Shot 2022-04-27 at 16 45 47

Desktop (please complete the following information):

  • OS: OSX
  • Excelerate Version: 0.1.0
  • Output of echo $PSVersionTable:
echo $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.2
PSEdition                      Core
GitCommitId                    7.2.2
OS                             Darwin 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.…
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

[REQUEST] Check destination file before repairing

Is your feature request related to a problem? Please describe.
Currently, the Excel file is cleaned before checking if the destination file is writable. This means that lots of time is wasted up front if an unwritable location was specified.

Describe the solution you'd like
A check that the destination file is writable should be done before cleaning the file. Ideally a filelock would be obtained.

[REQUEST] Allow passing directory instead of file

Describe the solution you'd like
It would be nice to pass an input/output directory in Repair-XLSX, and scan the entire directory for XLSX files and operate on all of them.

Describe alternatives you've considered
A simple shell foreach loop does the same thing, but frequent operation on directories mean building in this functionality would save time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.