Errata

Writing Excel Macros with VBA

Errata for Writing Excel Macros with VBA

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page xii
2nd paragraph

You refer to the "enormity" of the subject. Should this be "magnitude", because
enormity means great evil?

Anonymous   
Printed Page xvii
5th para

this states "The sample programs ... are available online ..."
but are not found at the url listed

Anonymous   
Printed Page 10
Table 2-1, 3rd row

C, C++ A very powerful languages...

Should be:

C, C++ Two very powerful languages...

or:

C, C++ A very powerful language...

Anonymous  Aug 31, 2016 
Printed Page 32
8th paragraph, begins "Notice also that there are..."

First sentence says "...such has how far to indent code..."

Should be:

"...such as how far to indent code..."

Anonymous  Sep 02, 2016 
Printed Page 49
Under the XlAutoFillType example (Enums)

In the text it says "(The Excel documentation incorrectly refers to this enum as
XlFillType.)"
It appears that this has been corrected in the version I use (MS Office Excel 2003 SP
2) as it in that documentation is correctly called XlAutoFillType.

Anonymous   
Printed Page 49
middle (code example)

The text for the example says:

"the following line of code will autofill the first seven cells in the first row of
the active sheet with the days of the week, assuming that the first cell contains the
word Monday:"

The statement that the cell should contain the word "Monday" is only correct if you
have your language options set to English. In my case I have to write "m?ndag"
(Swedish for Monday) to get the example to work and not just copy the word "Monday"
to every cell in the range.

Anonymous   
Printed Page 74
1st paragraph

Note that very confusingly if you omit the Call keyword, you don't get an error, but excel silently handles the arg passing as ByVal, even if ByRef is stated.

If you omit the Call AND the parantheses around the argument, then it works ok.

Anonymous   
Printed Page 75
Example 6-5

Example 6-5
Sub ProcedureA uses "sText" as a string, and then uses a function "CountCharacters" which uses a variable "STxt" where it should be "SText"

Anonymous  Oct 13, 2008 
Printed Page 78
First paragraph

"Table 7-1 shows the VBA functions, and Table 7-2 shows the statements."
Table 7-2 (on page 80) shows the MsgBox Buttons Argument Values.

Anonymous   
Printed Page 135
Example 10-2 The CreateCustomMenuItem Procedure

I'm looking at the first edition of the book, so the page number may have changed,
but the error is still in the examples file I just downloaded. The example contains
this line: "Dim cbpop As CommandBarControl". This should be "Dim cbpop As
CommandBarPopup". This matters because later in the example you encounter this line:
"With cbpop.Controls.Add(Type:=msoControlButton, Temporary:=True)". The IDE does not
recognize Controls as being a member of cbpop, because it is not a member of
CommandBarControl. It is however a member of CommandBarPopup, so if you change the
Dim statement, the IDE likes it a lot better. I'm using Excel 97 -- perhaps later
versions are different.

Anonymous   
Printed Page 154
2nd paragraph

The first sentence of the second paragraph refers to the THIRD column of figure 12-5
and then proceeds to describe the FOURTH column. No explanation is actually given in
the text for the third column.

Anonymous   
Printed Page 155
last paragraph

second sentence of the last paragraph contains the following text:

'...is set to a procedure called RunUtility, as the "onActivation Proc" column in Figure 12-3 shows.'

should read

'...is set to a procedure called RunUtility, as the "OnAction Proc" column in Figure 12-5 shows.'

Anonymous   
Printed Page 161
1st paragraph

2nd line of example 12-17 should read
"findControl(Type:=msControlPopup, Tag:="SRXUtilsCustomMenu")

i.e not Tag:="TestAddInCustomMenu"

this prevents the customised menu from beeing deleted when the addin is closed.

Anonymous   
Printed Page 229
1st paragraph

You give the field format of the last field as 6: "Array(4, 6)". According to the
table on p. 228, the value 6 corresponds to a date format of MYD, whereas the dates
in your test data are actually in MDY (or maybe DMY) format. So I don't think that
test data and code sample could have produced the Excel file shown in figure 17-2,
halfway down p. 229.

Anonymous   
Printed Page 234
1st paragraph, 3rd line

"If we set the Saved property to True, then the Close method will ... close ...
without saving any unsaved changes."

The saved property "False" generates this action, not "True"

Anonymous   
Printed Page 235, 247, 296, 446
PrintOut Method

The syntax for the Printout method is not up-to-date for Excel 2000 and Excel XP.
It should be:
expression.PrintOut(From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate,
PrToFileName)
PrintToFile causes Excel to print to a file. Excel will prompt the user for
the name of the output file.
PrToFileName: If PrintToFile is set to True, this argument specifies the name of the
file you want to print to. Since the user can specify the output file name in code,
the line withe thin brackets should be deleted.

Anonymous   
Printed Page 261
example 18-4 firsy paragraph

on the down loaded version of print.xls the programing for the print sheet user form is wrong.
in the initialise subroutine the following line:

If UBound(sSheets) < cSheets Then
should read
If UBound(sSheetNames) < cSheets Then

this is correct in the book but is uncorrect in the version of print.xls downloaded

Anonymous   
Printed Page 345
1st block of code CreatePivot()

SourceData:="'Company Both'!R1C1:R145C7"
Should Read
SourceData:="'Source'!R1C1:R145C7"

Anonymous   
Printed Page 446
last paragraph

I think "Figure 21-6" should be replaced with another figure reference.

Anonymous