Incode Systems Home Page Incode Systems, Inc.

Sunday, April 15, 2012 11:50 pm


XLScript is a new command line utility that automates changes to Excel spreadsheets.

XLScript - Copyright (C) 2007-2012, Incode Systems, Inc.
version 1.0.0

Usage: [options] XLSFileName[.xls] ScriptFile [LogFileName]

XLScript uses Excel OLE Automation to modify XLSFileName
using commands contained in ScriptFile.

ScriptFile is a text file containing one command per line.
Commands are optionally followed by a space and a value.
Text values containing carriage returns or line feeds
should be escaped with \r and \n. Backslash is escaped as \\.
Text values which could be interpreted as dates or numbers
should be preceeded with a single quote character, just as
when entered manually.

XLScript by default checks the Active Sheet and the selected cell
when it starts, and restores these values when it exits.

-as- Do not AutoSave XLS file (default is to save)
-be- Do not unescape backslashes (default is to escape)
-rr- Do not restore Selected Range (default is to restore)
-rs- Do not restore Active Sheet (default is to restore)
-s:SheetName Select Sheet (example: "-s:My Sheet")
 (If SheetName is not given, default is active Sheet)
-o Open in Excel

(commands are a word optionally followed by a space and a value)
ColumnWidth (value is column width, default is 8.43)
FontColor (value is color index / name applied to selection)
FontFace (value is font name applied to selection)
FontSize (value is font size applied to selection)
Formula (value is cell value or formula)
FormulaR1C1 (value is cell value or formula in R1C1 notation)
NumberFormat (value is the format applied to selection)
RowHeight (value row height, default is 12.75)
SelectAll (value ignored)
(for commands below, value is range to select)
Copy (Edit / Copy)
Cut (Edit / Cut)
DeleteColumns (deletes all columns in selection)
DeleteRows (deletes all rows in selection)
InsertColumns (inserts number of columns in selection)
InsertRows (inserts number of rows in selection)
Paste (Edit / Paste)

Range reference macros:
Any cell or range reference may include the following macros:
&Column& (the selected column)
&Column1& (the selected column when originally opened)
&ColumnsCount& (the number of columns used)
&ColumnsCount1& (the number of columns used when originally opened)
&Row& (the selected row)
&Row1& (the selected row when originally opened)
&RowsCount& (the number of rows used)
&RowsCount1& (the number of rows used when originally opened)
If a plus or minus sign followed by a number may be included.
Calculated results less than 1 are treated as 1.

A&RowsCount+1& (row below last used in column A)
D2:&ColumnsCount&&RowsCount& (range from D2 to the end of the sheet)

ERRORLEVEL is 0 if Ok, or one of the following:
1 - XLSFileName not found
2 - Unable to overwrite FileName
3 - Excel not found.
4 - Excel error.
5 - DataFile cannot be read.
6 - Excel sheet not found.

XLScript - Copyright (C) 2007-2012, Incode Systems, Inc.
version 1.0.0
(to view entire help, type: XLScript | MORE)