A
andreas
Dear Experts:
I declared a Public Constant whose value is valid for a COUPLE of
macros. The declaration statement to define the value of the constant
is as follows:
Public Const strConstantBlue As String = "RGB(79, 129, 189)"
The above defined constant will then be used in below macro as well as
several similar macros. I declared a Public Const so that I just have
to alter the RGB values in one place, should a change be required.
Regrettably the macro throws error messages, telling me that a runtime
error 13 has occurred. What's wrong with the declaration statement of
the Public Constant?
Sub BordersBlue()
Set myTable = Selection.Tables(1)
With myTable.rows(1)
..Borders(wdBorderTop).LineStyle = wdLineStyleSingle
..Borders(wdBorderTop).LineWidth = wdLineWidth050pt
..Borders(wdBorderTop).Color = strConstantBlue
End With
With myTable.rows(1)
..Borders(wdBorderBottom).LineStyle = wdLineStyleSingle
..Borders(wdBorderBottom).LineWidth = wdLineWidth050pt
..Borders(wdBorderBottom).Color = strConstantBlue
End With
End Sub
I declared a Public Constant whose value is valid for a COUPLE of
macros. The declaration statement to define the value of the constant
is as follows:
Public Const strConstantBlue As String = "RGB(79, 129, 189)"
The above defined constant will then be used in below macro as well as
several similar macros. I declared a Public Const so that I just have
to alter the RGB values in one place, should a change be required.
Regrettably the macro throws error messages, telling me that a runtime
error 13 has occurred. What's wrong with the declaration statement of
the Public Constant?
Sub BordersBlue()
Set myTable = Selection.Tables(1)
With myTable.rows(1)
..Borders(wdBorderTop).LineStyle = wdLineStyleSingle
..Borders(wdBorderTop).LineWidth = wdLineWidth050pt
..Borders(wdBorderTop).Color = strConstantBlue
End With
With myTable.rows(1)
..Borders(wdBorderBottom).LineStyle = wdLineStyleSingle
..Borders(wdBorderBottom).LineWidth = wdLineWidth050pt
..Borders(wdBorderBottom).Color = strConstantBlue
End With
End Sub