Compare Excel Workbooks With DiffEngineX Version 227

40
pdfcrowd.com PRO version Are you a developer? Try out the HTML to PDF API Overview DiffEngineX reports the differences between two Microsoft® Excel workbooks. You can choose whether to compare every worksheet contained in the two books (select Whole Workbooks) or just selected sheets (select Selected Sheets). If you compare at the Whole Workbook level, worksheets with the same name are automatically compared with each other. If you want to compare two sheets with different names you must select Selected Sheets and make sure only one sheet is selected in each of the list boxes. DiffEngineX only reports on the differences between the formulae, constants, defined names, cell comments and Visual Basic code found in spreadsheets. It does not compare charts. Every comparison will generate a new workbook listing each cell difference. This new workbook will contain one worksheet for every pair of sheets compared. Its very last worksheet is a summary of the number of different cells found in each pair. DiffEngineX does not modify the workbooks you select to be compared in any way. However when some of its options are selected it will create in-memory copies of your workbooks and modify these instead. DiffEngineX needs to modify these copies as part of the work done for Color Differences At Cell Level, Align Rows, Align Columns and Highlight Character Level Differences. Click here to get the free trial version of DiffEngineX. The Short Guide To Using DiffEngineX can be found here . A step-by-step tutorial on how to compare two lists of data can be found at the bottom of this help page.

description

A free trial version of DiffEngineX is available from http://www.florencesoft.com/excel-differences-download.htmlDiffEngineX is a software product that reports on the differences between two Microsoft Excel spreadsheets. This help file has been updated for version 2.27 of DiffEngineX and should be read in preference to the earlier "compare excel workbooks" document at Scribd.

Transcript of Compare Excel Workbooks With DiffEngineX Version 227

Page 1: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

Overview

DiffEngineX reports the differences between two Microsoft® Excel workbooks. You can choose whether to compareevery worksheet contained in the two books (select Whole Workbooks) or just selected sheets (select SelectedSheets). If you compare at the Whole Workbook level, worksheets with the same name are automatically comparedwith each other. If you want to compare two sheets with different names you must select Selected Sheets and makesure only one sheet is selected in each of the list boxes.

DiffEngineX only reports on the differences between the formulae, constants, defined names, cell comments andVisual Basic code found in spreadsheets. It does not compare charts.

Every comparison will generate a new workbook listing each cell difference. This new workbook will contain oneworksheet for every pair of sheets compared. Its very last worksheet is a summary of the number of different cellsfound in each pair.

DiffEngineX does not modify the workbooks you select to be compared in any way. However when some of itsoptions are selected it will create in-memory copies of your workbooks and modify these instead. DiffEngineXneeds to modify these copies as part of the work done for Color Differences At Cell Level, Align Rows, AlignColumns and Highlight Character Level Differences.

Click here to get the free trial version of DiffEngineX.

The Short Guide To Using DiffEngineX can be found here.

A step-by-step tutorial on how to compare two lists of data can be found at the bottom of this help page.

Page 2: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

Important

If it seems DiffEngineX is failing to spot similarities between worksheets and as a result is reporting spuriousdifferences, you will need to select Align Columns and/or Align Rows. Alignment is the insertion of blank rows and/orcolumns such that the identical cells in two sheets end up with the same row and column numbers. Identical cells areonly recognised for what they are if they have the same row and column numbers.

When Align Columns is selected you will be asked to select a row (or the rows) containing column headings, afterthe Start Comparison button has been pressed. If the sheets being compared do not have column headings, select arow present in both sheets that has the same meaning and same row number.

When Align Rows is selected you will be asked to select a column (or the columns) that will be looked at duringthe process of row alignment, after the Start Comparison button has been pressed. Selection of one or two columnsthat act as unique row identifiers will work for most cases. NOTE: You may need to get Microsoft Excel to pre-sortrows of data before using DiffEngineX. Please refer to our tutorial.

By default Align Rows and Align Columns only align matching rows and columns. They are not concerned withunmatched rows and columns. Select Use Alignment Plus to ensure that unmatched rows and columns in sheet #1are explicitly paired with blank rows and columns in sheet #2. This makes it easier to spot deletions and insertions.

If your worksheets contain mostly formulae, it is recommended that Use Alignment Plus is turned off.

It is recommended the Color Differences At Cell Level is always selected as it offers a much clearer way to seedifferences compared to a cell-by-cell listing.

Two important important options to find out about are Compact Like Changes When Contiguous and The ActualFormulae/Their Calculated Values.

Highlight Character Level Differences

Page 3: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

This option directly colors in red differences found at the character level for text, formulae, numbers and dates on theworkbook copies. As part of this operation, numbers, formulae and dates will be single quoted first. Excel does notallow these types to be colored at the character level without a preceding single quote. The introduction of a singlequote means that the workbook copies produced by DiffEngineX can now only be viewed as reports listingdifferences rather than functional spreadsheets. If the option to compare the values of formulae, rather than theformulae themselves, is selected then formulae will be substituted by their values on the workbook copies, where thevalues are found to differ. Your original workbooks are not altered by this process.

This should not be confused with Color Differences At Cell Level which only indicates differences at the whole celllevel or Color in Red Precisely The Parts of Formulae and Text Constants That Differ which highlights character leveldifferences on the difference report.

This option should be used with care as it can greatly slow down comparisons when the number of differences islarge.

International Users

If your current regional settings do not match the language version of Office/Excel installed, DiffEngineX may notwork correctly.

To prevent problems it is recommended you select the option Ensure application works when Excel languageversion not equal to Regional Settings.

Difference Report

The difference report is generated in a new workbook. It contains one worksheet for every pair of worksheetscompared. Its last sheet is a summary of the number of differences found.

Page 4: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

The entries list the cell differences. They are organized into five columns.

The first column contains the addresses of cells found to differ. (Each entry is the address of a single cell unless theoption Compact Like Changes When Contiguous has been selected.) If row/column alignment is selected, theaddresses refer to the workbook copies made by DiffEngineX. These addresses will differ from the ones in youroriginal workbooks if blank alignment rows/columns have been inserted.

The next two columns quote the cell content found to differ.

The last two columns are only relevant if row and/or column alignment is selected. They contain the cell addresses ofthe different content in the original workbooks selected for comparison. These are unaffected by the insertion ofblank alignment rows and columns. Blank rows and columns are only inserted in workbook copies. If you arereferring back to your original workbooks you should use the values in these two columns rather thanthe very first one.

Extras

When Color Differences At Cell Level is selected, the cells that differ between two sheets are highlighted withcolor. When the comparision has finished, copies of the two workbooks you selected are generated with the addedcolor, in addition to the difference report workbook. Once again these are _copies_ of your workbooks and will notbe saved to your hard drive unless you ask Microsoft® Excel to.

The Extras dialog allows you to specify what colors are used. It is invoked by pressing the Extras button.

In the Extras dialog, a deleted cell is defined as a cell with content in Workbook #1, but no content in Workbook #2.An addition is defined as a cell with content in Workbook #2, but no content in Workbook #1. In this respectWorkbook #1 can be considered the original workbook and Workbook #2 the modified copy. However thesedefintions can be changed using the option described below.

Page 5: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

Interpret Modified Cell As Deletion And Addition (Deprecated)

When row alignment is selected, DiffEngineX makes sure that rows with the same identifiers (these identifiers are inthe columns you specify for row alignment) line up and are not color highlighted unless the rest of the row differs.

Suppose a row with 23 for its unique identifier is deleted from the original. The modified spreadsheet has thenumber 27 in a corresponding cell. Should DiffEngineX color this as a modified cell in both sheets (default: lightorange) or is it really a deletion (default: red) from the original sheet and an addition (default: green) in the modifiedsheet?

This option found on the Extras dialog allows you to decide. Excel 2007 allows users to sort on color and as such itis now possible to easily see all the added rows and all the deleted rows together without different types of rowsgetting in between them. A sorting step in Excel is needed afterwards.

By default this option is not selected. Align Rows has to be selected as well. This option only affects the cells in thecolumns specified for row alignment i.e. the chosen unique row identifiers.

This option is no longer recommended. Please select Use Alignment Plus instead, which works for both row andcolumn alignment.

Existing Color Removal

Existing workbook color may make inspection of the results difficult. The Extras dialog offers you the option ofremoving unconditional color from the workbook copies before it starts to highlight the differences. Color is notremoved from the original workbooks you select.

Existing Hidden Sheets/Cells

Excel allows spreadsheet authors to hide whole rows and columns. Additionally whole sheets may be madeinvisible. Differences may occur in these hidden regions. Obviously there is little point in coloring a pair of cells if the

Page 6: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

results cannot be seen. An option exists to unhide sheets, rows and columns on the workbook copies, regardless ofwhether they are hidden directly or by use of filters. The original workbooks are not modified by selecting this option.Note that selecting this option will only have an effect if Color Differences At Cell Level is also selected on themain part of the user interface.

It is recommended that this option is always kept selected if you make use of hidden cells or filtered rows.

Hide Rows (Matching or Different)

If large worksheets are compared and the different rows are widely separated, inspection of all the color highlightedrows may be difficult. An option exists to hide the matching rows, leaving just the different rows visible. SelectingHide Matching Rows for this option will hide all matching rows. Selecting Hide Matching Rows, but show 4rows on either side as context will leave a few rows visible around each differing row.

If you wish to see the opposite (only the rows with no differences) you should select Hide Different Rows. Thishides all the rows that differ, leaving just the matching rows behind. Hide Different Rows, but show 4 rows oneither side as context will make sure a few rows are visible around each matching row.

Note that selecting any of these options will only have an effect if Color Differences At Cell Level is also selectedon the main part of the user interface.

Limitations: Cell comments are not taken into consideration when hiding rows.

If you require the individual characters that differ between cells precisely highlighted on the difference report, see theoption Color in Red Precisely The Parts of Formulae and Text Constants That Differ.

Align Columns

If your are comparing an original worksheet to its modified copy and part of the modifications included the insertion

Page 7: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

or deletion of columns you will need to select Align Columns.

Without Align Columns similar regions in the sheets will be incorrectly reported as different just because the samecontent is shifted to the left or right.

When the Align Columns checkbox is selected you will be asked to specify what rows are used to help with columnalignment after pressing the Start Comparison button. A good choice is to select the row containing columnheadings, if one exists. At the very least select the first row that contains content.

If the modifications that have taken place do not include the insertion or deletion of columns this option should not beselected.

Align Columns works by inserting blank columns into the workbook copies being compared. These blank columnsare color highlighted. The color used can be specified with the Extras dialog.

Align Columns Example

Consider the workbooks original.xls and modified.xls shown in Figure 1. You can see the new Website column hasbeen inserted into modified.xls.

original1.xls and modified1.xls are the result of a comparision without column alignment. You can see the Personaland Work Emails have been incorrectly flagged as different.

original2.xls and modified2.xls are the result of a comparison with column alignment. Row 1 was added to theSelected Rows list using the Align Columns dialog box. Row 1 contains the column headings of First Name,Last Name, (Website), Personal Email and Work Email. The new Website column cells are correctly flagged as newcontent by use of the color green.

Align columns also works when columns have been deleted.

Figure 1.

Page 8: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

Align Rows

If you are comparing an original worksheet to its modified copy and part of the modifications included the insertion ordeletion of rows you will need to select Align Rows.

Without Align Rows, similar regions will be incorrectly reported as different just because the same content is shiftedup or down.

Page 9: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

When the Align Rows checkbox is selected you will be asked to specify what columns are used to help with rowalignment after pressing the Start Comparison button. For rows of data, you should select the column or columns thatact as unique row identifiers. If you are not comparing data, a reasonable choice is to select the first column or twowith content.

NOTE: You may need to get Microsoft Excel to pre-sort rows of data before using DiffEngineX. Please refer to ourtutorial.

If the modifications that have taken place do not include the insertion or deletion of rows this option should not beselected.

Align Rows works by inserting blank rows into the workbook copies being compared. These blank rows are colorhighlighted. The color used can be specified with the Extras dialog.

Align Rows Example

Consider the workbooks original.xls and modified.xls shown in Figure 2. You can see a new row with the content {4400, Sports Car, 999 } has been added.

original1.xls and modified1.xls are the result of a comparison without row alignment. You can see three rows havebeen incorrectly flagged as different, when only 1 new row was added.

original2.xls and modified2.xls are the result of a comparison with row alignment. Column A was added to theSelected Columns list using the Align Rows dialog box. Column A contains order numbers that uniquelydescribe the contents of each row. The new row is correctly flagged as new content by use of the color green.

Align Rows also works when rows have been deleted.

Figure 2.

Page 10: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

Options

Page 11: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

E2:G2 =A1*3 =A1*9

Compact Like Changes When Contiguous

Selecting this option can potentially reduce the verbosity of DiffEngineX reports.

For example if three adjacent cells contain equivalent content and they are all changed to the same formulae orconstant, the change is reported on one line instead of three.

For example

*

will be listed instead of

E2 =A1*3 =A1*9F2 =B1*3 =B1*9G2 =C1*3 =C1*9

*For multi-cell ranges of equivalent formulae, the one A1 style formulae shown is relative to the first cell of the range.

Color Alternate Rows

Selecting this option makes difference reports easier to read as every other row is color highlighted.

Color in Red Precisely The Parts of Formulae and Text Constants That Differ

Selecting this option highlights the exact parts of formulae and text constants, with the color red, that differ betweentwo worksheets. The highlighting is applied to the cell content quoted on the difference report.

Dates and numeric constants are not covered by this option.

Page 12: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

This option can slow down comparisons when the number of cell differences is large. It is recommended thatCompact Like Changes When Contiguous is selected as well with this option in order to reduce the amount of workneeded to be performed on each difference report.

This option should not be confused with Color Differences At Cell Level which is available on the main part of theuser interface. Color Differences At Cell Level applies background color to whole cells on copies of theworkbooks selected for comparision. The option discussed here applies foreground color to selected parts offormulae and text constants on the difference report.

Highlight Character Level Differences is similar in action to this option, however it works on the workbook copiesrather than on the difference report.

An example of the precise highlighting offered by this option is shown below.

E1 =A1+Costs+4 =A1+NewCosts+6G2 The quick cat. The slow cat.

Compare Excel Defined Names

Select this option to compare Excel defined names. The results will be listed on the difference report.

Excel allows names with either workbook or worksheet-level scope to be created. Workbook-level scope names areonly compared when Whole Workbooks is selected on the main part of the user-interface. Likewise if /sheets issupplied as a command-line argument, workbook-level scope names are not compared.

Ranges and formulae referred to by names are always reported in R1C1 notation regardless of DiffEngineX's A1 orR1C1 notation setting.

This is because a cell reference in R1C1 notation is self-contained. Cell references in A1 notation can only be

Page 13: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

understood with reference to what Excel regards is the Active Cell at a particular moment in time, if they have anypart of them that is a relative rather than absolute reference.

For example the Excel defined name and definition of CellBelow = Sheet1!R[1]C unambiguously refers to the cell 1row down and 0 columns across, regardless of what the Active Cell happens to be at the time

However in A1 notation the same Excel defined name and defintion is

CellBelow = Sheet1!D18 when the Active Cell is $D$17

and

Cell Below = Sheet1!E18 when the Active Cell is $E$17

and

CellBelow = Sheet1!J3 when the ActiveCell is $J$2.

As such, due to relative references, it is better to compare name definitions in R1C1 notation.

When using this option you may also want to turn on Color in Red Precisely The Parts of Formulae and TextConstants That Differ.

If the names in Sheet1 are compared against the names in Sheet2, then the name Sheet1!MyName will becompared against Sheet2!MyName i.e. the worksheet-level scope name prefixes are ignored. Any sheet prefixes inthe actual defintion are compared as-is i.e. Sheet1!MyName = Sheet1!$A$1 will be treated as a modification ofSheet2!MyName = Sheet2!$A$1.

Add Hyperlinks To Aid Navigation

Page 14: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

Figure 3.

Selecting this option adds three kinds of hyperlinks to the difference report (titled Sheet1 by default).

1. Internal links between the Comparison Summary sheet and the individual sheets listing the differences for eachpair of compared sheets.

2. Links to the workbook copies created by DiffEngineX as part of the comparison process. These may be colorhighlighted and have blank rows inserted for alignment. However, if the user closes these temporary copies,the hyperlinks will no longer work. Each link leads to a cell found to differ.

Page 15: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

3. Links to the unaltered, input spreadsheets supplied by the user. Each link leads to a cell found to differ.Unfortunately these links only work properly in Excel 2007. In Excel 2002/XP and Excel 2003, these linksmistakenly jump to the workbook copies instead. This is a problem intrinsic to Excel. This can be fixed byclosing the workbook copies first

Annoyances: Excel displays a warning when clicking on a link to an external workbook. If the workbook containing the link is savedto the file system, this warning is no longer shown.

It may be more convenient to generate a difference report with hyperlinks via the Command Prompt. This way thecolor highlighted copies and the difference report are automatically saved to the file system and the warning dialogboxes and pre-Excel 2007 problems can be avoided.

Sample commands are given below. Mutiple commands can be added to a *.cmd file. Although the examples shownhere are split across several lines, ensure that each individual command does not contain newlines or carriagereturns.

Excel 2003 "C:\Program Files\Florencesoft\DiffEngineX\DiffEngineX.exe"/inbook1:"c:\my books\original.xls"/inbook2:"c:\my books\modified.xls"/outbook1:"c:\my books\outbook1.xls"/outbook2:"c:\my books\outbook2.xls"/report:"c:\my books\report1.xls"/alignrows:"A" /coloralternaterows /colordifferences/addhyperlinks /show

Excel 2007 "C:\Program Files\Florencesoft\DiffEngineX\DiffEngineX.exe"/inbook1:"c:\my books\original.xlsx"/inbook2:"c:\my books\modified.xlsx"/outbook1:"c:\my books\outbook1.xlsx"/outbook2:"c:\my books\outbook2.xlsx"

Page 16: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

/report:"c:\my books\report1.xlsx"/alignrows:"A" /coloralternaterows /colordifferences/addhyperlinks /show

Compare Comments

Select this option to compare Excel comments. The results will be listed on the difference report.

When using this option you may also want to turn on Color in Red Precisely The Parts of Formulae and TextConstants That Differ.

Limitations: Cell comments are not taken into consideration when hiding different or matching rows.

Compare Visual Basic Code / Macros

This compares the Visual Basic for Applications (VBA) code and macros embedded in your spreadsheet. In orderfor this option to work you must change your default Excel options. If you are using Excel 2007 or later, go to ExcelOptions->Trust Center->Trust Center Settings...->Macro Settings and ensure that Trust access to the VBA projectobject model is checked.

If you are using Excel 2003 (or earlier), change the relevant option under Tools->Macro->Security...->TrustedPublishers.

Page 17: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

The Visual Basic difference report is generated as linked HTML pages and is displayed in your default webbrowser. If the difference report is generated via DiffEngineX's user interface it will be placed in a temporarydirectory and kept for seven days, unless moved to another directory. If the report is generated by invokingDiffEngineX from the command-prompt, it will be kept until DiffEngineX is run again with the same user-specifiedoutput directory.

Page 18: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

All the Visual Basic code modules, class modules, code behind userforms and macros are compared regardless ofwhether Whole Workbooks or Selected Sheets is selected. Empty code modules are ignored.

The DiffEngineX options relating to how spreadsheets cells are compared and color highlighted are not used whencomparing Visual Basic, except for Case Insensitive Comparisons.

A key to the colors used to indicate the comparison results are given below.

Deleted Text Added Text Moved Up Moved Down Not Changed

Page 19: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

A1 or R1C1 Notation

The reports DiffEngineX generates contain cell content where it is found to differ. If the differing content containsformulae this option allows it to be reported in either A1 or R1C1 notation. In A1 notation rows are labelednumerically and columns are labeled alphabetically. In R1C1 notation, both columns and rows are labelednumerically.

Case Insensitive Comparisons

Page 20: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

Select this option if you want cell content to be compared without regard to its capitalization. For example when thisoption is checked the constant "Sales" will be treated as equivalent to "sales".

Ignore Smart Character Differences

When this option is selected, curly double (“ and ”) and single quotes (‘ and ’) will be treated as equivalent to theirstraight counterparts (" and '). The dash character (–) will be treated as equivalent to a hyphen (-).

White Space

Select Ignore Surrounding White Space if you want cell content to be compared without regard to leading andtrailing white space. For example when this option is checked the text " cats and dogs " will be treated as equivalentto "cats and dogs". White space between characters and words is not ignored.

Select Ignore All Non-Significant White Space if you want all superfluous white space to be ignored. Thisincludes leading and trailing white space. This means that two or more adjacent white space characters will betreated as being only one white space character. For example when this option is checked the text " cats and dogs "will be treated as equivalent to "cats and dogs".

The quotation marks have been added for clarity and are not part of the text.

The Actual Formulae or Their Calculated Values

If two cells containing formulae are being compared, a choice has to be made whether to compare the actualformulae themselves or their calculated values.

For example if two cells containing =2*6 and =3*4 are compared with The Actual Formulae checked they will bereported as different. If Their Calculated Values is checked they will be reported as identical.

Page 21: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

Test For An Exact Numeric Match

Numbers are tested for an exact numeric match. Any difference, however small, will be reported.

If you wish to compare the calculated values of formulae, rather than the formulae text itself, you should select theoption Their Calculated Values.

Compare Up To [x] Decimal Places

Select this option to specify the maximum number of digits after the decimal point that are used when comparingnumeric values. In this way it is possible to have the values 3.1428 and 3.1429 treated as being equal whencomparing up to 3 decimal places.

Use this option together with Round Away From Zero or Round To Even.

If you wish to compare the calculated values of formulae, rather than the formulae text itself, you should select theoption Their Calculated Values.

Smallest Difference Is [x]

This option allows you to specify that a pair of numbers will only be flagged as different if the absolute value of theirdifference is at least as great as the number provided by the user. Only positive, non-zero, values are permitted. Ifthe smallest difference is set to 10, then the numbers 1000 and 1009 will be treated as being equal.

If you wish to compare the calculated values of formulae, rather than the formulae text itself, you should select theoption Their Calculated Values.

Smallest Percentage Difference Is [x] %

This option allows you to specify that a pair of numbers will only be flagged as different if the percentage change

Page 22: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

(increase or decrease) from the first number to the second number is at least as great as the percentage providedby the user. Only positive, non-zero, percentages can be entered.

If you specify that changes of 10% and above will be considered, then 10 will be found to differ from both 9(percentage decrease) and 11 (percentage increase). Effectively the sign of the percentage change is ignored.

As a further example, if you specify that only percentage changes of 120% and above will be considered, then 0.5will be found to differ from -0.1 (a 120% decrease) as well as 1.1 (a 120% increase). Obviously any number above1.1 and below -0.1 will be found to differ as well.

When specifying the pair of spreadsheets to be compared, one workbook is designated #1 and the other #2. Thedesignation of which spreadsheet is #1 and #2 can affect the results you see. To understand this statement considerthe following. The percentage increase from 1 (workbook #1) to 100 (workbook #2) is 9900%. However thepercentage decrease from 100 (workbook #1) to 1 (workbook #2) is only 99%.

Our definition of the percentage change from cell#1 to cell#2 is ( Absolute_Value_Of(cell#1 - cell#2) /Absolute_Value_Of(cell#1) ) * 100.

Only the first 8 decimal places of the percentage difference you specify are used.

If you wish to compare the calculated values of formulae, rather than the formulae text itself, you should select theoption Their Calculated Values.

Round Away From Zero or Round To Even

This option is only used if you decide to compare a certain number of decimal places. Numeric values have to berounded before they are compared. When comparing to 1 decimal place, the number 2.45 is midway between 2.4and 2.5. If Round away from zero is selected it will be rounded to 2.5 before being compared. If Round to evenis selected the first decimal place will be rounded to the nearest even number and so give 2.4.

Page 23: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

Ensure application works when Excel language version not equal to Regional Settings

If your Control Panel Regional Options (such as French (Canada), Italian (Italy) etc.) do match the localized languageversion of Excel you have installed, DiffEngineX will generate error messages each time it is run.

To prevent problems you may wish to consider one of the below.

Purchase a localized language version of Excel that matches your Regional Options.Change your Control Panel Regional Options to match the language version of Excel.Check the DiffEngineX option Ensure application works when Excel language version not equal toRegional Settings.

Changing your Control Panel Regional Options is not recommended as it has wide ranging effects.

Only check the DiffEngineX provided option if you encounter problems.

Figure 4.

Page 24: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

Page 25: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

Command Line Arguments

If command line arguments are supplied to DiffEngineX, it will compare workbooks without its user interface beingdisplayed. This can be useful if you wish to compare multiple workbooks one after another using a series ofcommands stored in a *.bat file.

You must first locate the DiffEngineX.exe file. Typically it will have the location specified below.C:\Program Files\Florencesoft\DiffEngineX\DiffEngineX.exe

Values are passed to DiffEngineX by means of switches. Each switch is prefixed with a forward slash / and isseparated from its associated value or values by a colon :.

Some switches are associated with a single value. Others are associated with a comma separated list of values.File names and comma separated lists containing white space characters must be enclosed with double quotationmarks e.g.

The switch /sheets has been used to limit the comparison to the sheets Cash Flow, Notes and Annual Fin St.

Although the examples shown here are split across several lines, ensure that each individual command does notcontain newlines or carriage returns.

To display a list of all supported switches enter the following

Page 26: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

"C:\Program Files\Florencesoft\DiffEngineX\DiffEngineX.exe" /help from the command prompt.

The only mandatory switches are /inbook1 and /inbook2. /report is mandatory, unless /show is specified. Typicallyyou will want different cells to be color highlighted, identical changes grouped together (when adjacent) and theresults saved to disk. Your original input workbooks are not modified by the color highlighting. The changes aremade to copies. DiffEngineX will never overwrite existing spreadsheets. To ensure your commands are notinterrupted you should explicitly delete old reports beforehand. The below example achieves this.

The colors used to indicate modified, deleted and added cell content can be individually specified. If a color is notspecified on the command line, the one used by the user interface is taken. The example command belowadditionally specifies that existing workbook color be removed using the switch /removeexistingcolor.

The available colors (1 - 56) are shown in the palette below.

Page 27: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

Figure 5.

Exit Codes Versions 2.16 and above of DiffEngineX now return meaningful exit codes. Only versions 2.22 and above returncodes -5, -6 and -7. Only worksheet cell differences are included in the exit code. Defined name, comment and VBAmacro differences are not included.

Exit Code Description

Positive Integer Number of worksheet cell differences

0 No worksheet cell differences found

-1 General Error

-2 Number of differences greater than maximum integer value

Page 28: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

-3 Workbooks could not be compared due to protected worksheets

-4 Workbooks are different, at least, because of unpaired worksheet names

-5 Row or column alignment has failed

-6 Visual Basic difference report could not be displayed in a web browser

-7 Visual Basic difference report could not be output

Switches If a switch accepts a Boolean true or false value, then omitting the value is equivalent to specifying true i.e./colordifferences:true is the same as /colordifferences, but not the same as /colordifferences:false.

Example Switch and Value Description

Actionwhen

SwitchOmitted

/inbook1:"myworkbook1.xls" Path and file name of 1st book tocompare. Mandatory

/inbook2:"myworkbook2.xls" Path and file name of 2nd book tocompare. Mandatory

/report:"mydiffreport.xls" Path and file name of outputdifference report.

Mandatoryunless /showis specified.No copysaved.

Page 29: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

/outbook1:"coloredcopy1.xls"

Path and file name of altered copyof 1st book to output. Differentcells will be colored if/colordifferences specified aswell.

No copysaved.

/outbook2:"coloredcopy2.xls"

Path and file name of altered copyof 2nd book to output. Differentcells will be colored if/colordifferences specified aswell.

No copysaved.

/alignrows:"A,B"

Comma separated list ofalphabetical columns to examinewhen aligning rows (A - XFD). Amaximum of 80 columns can bespecified. Typically either "A" or"A,B" will be specified.

Similar rowswill not bealigned.

/aligncolumns:"1"

Comma separated list ofnumerical rows to examine whenaligning columns. A maximum of80 rows can be specified. Onlyuse this if all your sheets have adistinct row containing columnheadings.

Similarcolumns willnot bealigned.

/sheets:"Sheet1,Summary,Inputs" Specify this to limit comparisionsto specific sheets.

All thematchingsheets in the2 workbooks

Page 30: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

will becompared.

/colordifferences:true or falseIf true, different cells will be colorhighlighted. The /outbook1 and 2switches must also be specified.

Different cellswill becolored whenswitchomitted.

/removeexistingcolor: true or false

Remove unconditional fill colorfrom cells in workbook copies tomake color highlighting clearer.Note /colordifferences must alsobe specified.

No action.

/unhidesheetsrowscols: true or false

Hidden sheets, rows and columnsare made visible in workbookcopies so differences cannot beobscured. Note /colordifferencesmust also be specified.

Hiddensheets andcells will bemade visiblewhen switchis omitted.

/hiderows:n

n is integer (1 - 5). 1 hidesmatching rows. 2 hides matchingrows except those near differingrows. 3 hides different rows. 4hides different rows except thosenear matching rows. 5 hides norows. Note /colordifferences mustalso be specified. Takesprecedence over

No rows willbe hidden.

Page 31: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

/unhidesheetsrowscols.

/compactchanges:true or falseEquivalent changes to adjacentcells are grouped together indifference report.

No action.

/coloralternaterows:true or false Alternate lines in difference reportare colored. No action.

/colorpreciseondiffreport:true or false

Text and formulae differences arehighlighted at the character levelwith the color red on the differencereport. Time consuming option.

No action.

/colorpreciseonworkbooks:true or false

Text, formulae, number and datedifferences are highlighted at thecharacter level with the color reddirectly on the workbook copies.Time consuming option.

No action.

/compareexcelnames:true or false Excel defined name differencesare listed on the difference report. No action.

/addhyperlinks:true or false

Add hyperlinks to the differencereport to aid navigation. Refer tothe help file for limitations. Timeconsuming option.

No action.

/comparecomments:true or false Excel cell comment differencesare listed on the difference report. No action.

Directory to place the VisualBasic difference report in. Will

Page 32: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

/comparevisualbasic:"C:\Users\Bob\Documents\vbadiffoutput" Basic difference report in. Willoverwrite the previous report ifplaced in the same directory.

No action.

/stylea1:true or falseIf true, formulae are listed usingthe A1 style in the differencereport. If false, R1C1 is used.

A1 style isused whenswitchomitted.

/caseinsensitive:true or false If true, strings are comparedwithout regards to case.

If omitted,casesensitivecomparisionsare used.

/ignoresmartchardiffs:true or false

If true, curly double and singlequotes are treated as equivalentto their straight counterparts.Dashes are equivalent tohyphens.

If omitted,smartcharactersare treatedas different.

/whitespacehandling:n

n is integer (1 - 3). 1 does notignore white space. 2 ignoresleading and trailing white space. 3ignores all non-significant,including leading and trailing,white space.

If omitted, allwhite spaceisconsidered.

/compareformulae:true or falseIf true, formulae are directlycompared, rather than theircalculated end results.

If omitted,formulae arecompared.

Page 33: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

/ensureworksinternationally:true or false

If true, DiffEngineX will workdespite Control Panel RegionalOptions differing from thelanguage version of Excel.

DiffEngineXwill fail whenRegionalOptions donot equalExcellanguage.

/compareminimumdifference:d

d is a floating point number. Mustbe greater than or equal to4.94065645841247E-324. Whenspecified, numeric valuedifferences are only reported if >=the supplied value. Mutuallyexclusive to/compareminpercentdifferenceand /comparemaxdecimalplaces.

If omitted,numericvalues aretested for anexact match.

/compareminpercentdifference:d

d is a floating point number. Mustbe greater than or equal to4.94065645841247E-324. Whenspecified, numeric valuedifferences are only reported if thepercentage difference >= thesupplied value. Mutually exclusiveto /compareminimumdifferenceand /comparemaxdecimalplaces.

If omitted,numericvalues aretested for anexact match.

n is integer (-1 to 15). -1 to willcompare all fractional digits. 0 to15 will compare that many If omitted, all

Page 34: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

/comparemaxdecimalplaces:ndecimal places./roundawayfromzero determinesdecimal rounding. Mutuallyexclusive to/compareminimumdifference and/compareminpercentdifference.

If omitted, allfractionaldigits arecompared.

/roundawayfromzero:true or false

If true round away from zero, elseround to even. Value of this switchonly used if/comparemaxdecimalplaces usedto compare to a specified numberof decimal places.

If omitted,round awayfrom zero.

/modifiedcolor:nn is integer (1 - 56)./colordifferences must bespecified as well.

Userinterfacecolor used.

/deletedcolor:nn is integer (1 - 56)./colordifferences must bespecified as well.

Userinterfacecolor used.

/addedcolor:nn is integer (1 - 56)./colordifferences must bespecified as well.

Userinterfacecolor used.

/alignrowcolor:nn is integer (1 - 56)./colordifferences must bespecified as well.

Userinterfacecolor used.

/aligncolcolor:nn is integer (1 - 56)./colordifferences must be

Userinterface

Page 35: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

specified as well. color used.

/alignmentplus:true or false

If true, then not only align similarrows and columns, but make sureunmatched rows and columns pairup with blank rows and columns./alignrows and/or /aligncolumnsneed to be specified as well.Essentially this is a better versionof /interpretmodasadddel.

If omitted, itwill be used if/alignrowsand/or/aligncolumnsare specifiedas well.

/interpretmodasadddel:true or false

If true, interpret a pair of modifiedcells as one addition and onedeletion if they fall in column usedfor row alignment i.e. are uniquerow identifiers. /colordifferencesand /alignrows must be specifiedas well.

No action.

/show:true or false

If true, display the reports in Excelafter comparison. The VisualBasic difference report, ifgenerated, is shown in the defaultweb browser.

No action.

/help or /h or /?Displays the available switches.Any other switch, if specified aswell, is ignored.

No action.

Page 36: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

Tutorial: How to Compare Two Excel Lists

A common business problem often concerns finding out what names and addresses appear in one list but notanother. After the new data has been identified it is useful to be able to extract it into a new Excel workbook.

DiffEngineX can do the bulk of this type of work. Knowing a few Excel tricks and what options to select inDiffEngineX can greatly improve the end results.

Consider the two lists shown below. Even though DiffEngineX has the capability to align similar rows it needs somehelp from you first. This is because some of the changes involve not just the vertical displacement of rows, but areordering. In the first list the "Dobbs, Bob" row is before the "Rivers, Doreen" row. In the second list the order hasbeen reversed.

Figure 6 - Two Lists

DiffEngineX will insert blank rows to get existing rows to match up, but it will not reorder them.

To get around this problem you should ask Excel to sort your lists before using DiffEngineX to compare them.

Page 37: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

(Sorting is an optional step. Your data may not require it.)

Below we see our two original lists after Excel has sorted them on last and first name. Alternatively we could havesorted them by their ID column.

Figure 7 - Two Lists Sorted by Excel

Step-by-Step Instructions

1. First Sort using Excel & Save: Use Excel to open the two workbooks you want to compare. Click on any cell in the first list. Now click Excel'sData menu (or tab in Excel 2007) and select the Sort item. The Sort dialog will now appear. Sort by Last Nameand then by First Name. Hit OK. Now do the same for the second list. In your lists you can sort on anycombination of columns that uniquely identifies each row. (Sorting is not always necessary.)

2. Save both your sorted workbooks (under different filenames if you prefer) before closing them.

Page 38: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

3. Start up DiffEngineX - Use Options, Extras & Align Rows: Invoke DiffEngineX and click the Options button. In our example we can see that some street addresses are inupper case and others in lower case. Here we don't want such a trivial change to been counted as amodification and so we select the Case Insensitive Comparisons checkbox. Click OK to dismiss the dialogbox.

4. Click the Extras button. In our example both our lists are small, but in real life some lists may contain tens ofthousands of rows and have hundreds of differences between them. DiffEngineX uses color to highlightdifferences in automatically made copies of the workbooks it compares. We don't want to have to fish throughthousands of rows just to see a few differences. Make sure the Hide Matching Rows option is selected. ClickOK to dismiss the dialog box.

5. Select Align Rows on the main part of DiffEngineX's user interface. Ensure the Use Alignment Plus box ischecked. Ensure the Color Differences At Cell Level box is checked. Use the Browse buttons to point to yoursorted Excel workbooks. Click the Start Comparison button.

6. We now have to tell DiffEngineX what columns uniquely identify each row. As we previously sorted on LastName & First Name we select columns B and C before clicking the Add button. Hit OK to dismiss the dialogand start the comparison.

7. The results are shown below in figure 8. We can see DiffEngineX has correctly spotted the three new rows.However the matching rows are still in this workbook. They are only hidden. (You can see that Excel is notshowing rows 1, 2, 4, 5 and 7.)

Page 39: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API

8. The Final Step: Separate the Wheat from the Chaff: Select the Excel worksheet containing the color highlighted new rows. Click Excel's Edit menu and select GoTo. Click the Special... button. Click Visible cells only. (If you are using Excel 2007, select the Home tab. Thenselect Go To Special... from the Find & Select drop-down menu. Select Visible cells only.) Hit OK. Select Edit--->Copy. You have now selected and copied just the visible, new rows.

9. Create a new Excel workbook and use Edit--->Paste to copy across just the new rows. You now haveseparated the new rows from the hidden matching rows.

Note: For more complicated examples than shown here, rows may end up being colored red, green or light orangeby default to indicate differences. The colors red and green are used to indicate after row alignment one of twocorresponding cells is blank. Light orange means a cell has content in both sheets. You will have to inspect both thecolor highlighted sheets to find out all the differences.

Figure 8 - DiffEngineX Hides Matching Rows

Figure 9 - Use Excel's Edit--->Go To--->Special--->Visible cells only before Copy & Paste

Page 40: Compare Excel Workbooks With DiffEngineX Version 227

pdfcrowd.comPRO version Are you a developer? Try out the HTML to PDF API