R
Randy
We are using VBA to define an Excel validation list using the code extract shown below
With rngReportRow(1, 7).Resize(1, 45).Validatio
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween,
Formula1:="=offset($P$1198,1,0,$P$1198,1)
This code works fine for some Regional Settings on the computer running the VBA code. (E.g. "English (United States)", "English (United Kingdom)", "Japanese".) But when the Regional settings are either "Dutch (Netherlands)" or "German (Germany)" the Add method fails with an error #1004 (Application-defined or object-defined error).
To add to the curious nature of this problem, it disappears if a breakpoint is set on the Add method line. This might suggest a timing problem, however we have tried a number of different techniues to introduce an artificial delay prior to the Add method without success. (E.g. DoEvents, Wait, Loop, MsgBox.
I would greatly appreciate any suggestions for a solution or workaround to this problem. For reference, this problem was observed on systems running Excel 2000 (9.0.6926 SP-3) on Windows 2000 (5.00.2195 Service Pack 4)
Thanks for any help that you can offer
Cheers
Randy MacDonal
With rngReportRow(1, 7).Resize(1, 45).Validatio
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween,
Formula1:="=offset($P$1198,1,0,$P$1198,1)
This code works fine for some Regional Settings on the computer running the VBA code. (E.g. "English (United States)", "English (United Kingdom)", "Japanese".) But when the Regional settings are either "Dutch (Netherlands)" or "German (Germany)" the Add method fails with an error #1004 (Application-defined or object-defined error).
To add to the curious nature of this problem, it disappears if a breakpoint is set on the Add method line. This might suggest a timing problem, however we have tried a number of different techniues to introduce an artificial delay prior to the Add method without success. (E.g. DoEvents, Wait, Loop, MsgBox.
I would greatly appreciate any suggestions for a solution or workaround to this problem. For reference, this problem was observed on systems running Excel 2000 (9.0.6926 SP-3) on Windows 2000 (5.00.2195 Service Pack 4)
Thanks for any help that you can offer
Cheers
Randy MacDonal