Return to computer books' main page
Errata for Writing Excel Macros by Steven Roman - August 17, 1999
Unfortunately, someone at the copy editing level did some late-minute "editing" of the final manuscript after I approved it. This accounts for some rather embarrasing errors, such as the one on pages 50 and 135 (see below). Nevertheless, most of the errors are entirely my fault, for which I appologize sincerely.
Page 50
In the first display, replace
For example, the following code is treated as one line by Excel:
ActiveSheet.Range("A1").Font.Bold = True
with
For example, the following code
ActiveSheet.Range("A1").Font.Bold = _
True
is treated as one line by Excel.
Page 61
About 1/3 of the way down the page, change the text
For instance, the following code boldfaces the values in each of the 100 cells in the array:
For i = 1 To 100
Cell(i).Font.Bold = True
Next i
to
For instance, the following code boldfaces the values in each of the 100 cells along the diagonal of the active worksheet:
For i = 1 To 100
Set Cell(i)=Cells(i,i)
Cell(i).Font.Bold = True
Next i
Page 135
The code at the bottom of the page has a single, rather trivial error. Namely, in the first declaration
Dim cbpop As CommandBarControl
the variable cbpop should be changed to cbcpop. However, the entire code could be (and should) simplified by using only one variable:
Sub CreateCustomMenuItem()
Dim cbcpop As CommandBarControl
' Check for custom menu. If it exists then exit.
Set cbcpop = Application.CommandBars("Worksheet menu bar"). _
FindControl(Type:=msoControlPopup, Tag:="SRXUtilsCustomMenu")
If Not cbcpop Is Nothing Then Exit Sub
' Control does not exist -- create it.
Set cbcpop = Application.CommandBars("Worksheet menu bar"). _
Controls.Add(Type:=msoControlPopup, Temporary:=True)
cbcpop.Caption = "Cu&stom"
' Set tag property to find it later for deletion
cbcpop.Tag = "SRXUtilsCustomMenu"
' Add menu item to popup menu
With cbcpop.Controls.Add(Type:=msoControlButton, Temporary:=True)
.Caption = "&ActivateSheet"
.OnAction = "ActivateSheet"
End With
End Sub
Page 136
At the bottom of the page, the references to Figures 10-4 and 10-6 should be replaced by references to Figures 10-6 and 10-8, respectively.
Page 149
In the middle of the page, a reference to Application.Workbook should be changed to Application.CommandBars.
Page 154
The fourth line from the bottom, change
Print #fr, ctl.Caption & " (" & ctl.Id & ")"
to
Print #fr, ctl.Caption & " " & ctl.Id
Page 211
In the first line of text , the phrase "set of any" should read "set to any"
Page 407
A little below the middle of the page, I forget to remove the temporary code
' Temporary
If ActiveSheet.ChartObjects.Count > 0 Then
ActiveSheet.ChartObjects(1).Delete
End If
which removes the chart if it already exists. (I used this temporary code while developing the example.)
Return to computer books' main page