View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 1,726
Default Possible Validation.Modify bug in Excel 2000

I couldn't reproduce the problem. did you add the code into the sheet code
module?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



wrote in message
oups.com...
Hello,

I have a Data Validation in a cell say D5 of type xlValidateList.

I modify this validation in VBA:

sub foo ()
Range("d5").Validation _
.Modify Type:=xlValidateList,
AlertStyle:=xlValidAlertStop, Formula1:="Apple,Orange,Mango"
end sub

This works when run from the VB Editor.

If I create a Control Toolbox button and put the same code in say :
CommandButton1_Click it does not work.
Says "Application-Defined or Object-Defined error"

Again if I create a Forms Button and put the same code in the macro
assigned to the button it works.

Why doesn't it work when triggered from the Control Toolbox Button?

Regards
Gap