>In a program that has been working successfully for a long time we are suddenly getting an error message from the following line of code
>
>oXL.Application.WorkBooks.Open(lcFile)
>oXL.Cells.Select
>oXL.Selection.autofilter
>oSelection = oXL.Selection
>oSelection.FormatConditions.Add(2,[=],[=MOD($G1,2)])
>
>The last line errors with the following message
>
>MessageOLE error code 0x80070057: The parameter is incorrect.
>
>We are using Excel 2003
>
>I tried substituting the value for xlEqual instead of the equal sign but got the same message
>
>Can anybody shed some light on what might be causing this and what corrective action I can take?
>
>Thanks to all...........Rich
I do not know all the details of your excel file. So, as a shot in the dark, try:
oXL.Selection.FormatConditions.Delete
oXL.Selection.FormatConditions.Add(2,[=],[=MOD($G1,2)])
Good Luck