I have identified a difference in behavior between XL2000 & XL2007 that is most likely the source of error. In the code above I added/changed the last couple of lines to read
Debug.Print "Addresses before: " & Range(strAddresses).Count
sht.Scenarios.Add Name:="test", ChangingCells:=sht.Range(strAddresses), Values:=arrValues
Debug.Print "Addresses after: " & sht.Scenarios("test").ChangingCells.Count
XL2000 prints:
Addresses before: 27
Addresses after: 22
XL2007 prints:
Addresses before: 27
Addresses after: 27
Clearly, XL2000 is truncating the address set.
Sure looks like a bug to me!
g
Bookmarks