View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Set value of a cell with a dropdown list during run time (C#)

On Wednesday, August 14, 2013 10:05:38 AM UTC-5, GS wrote:
Hi there, I have a excel file that has dropdown list in a cell. I want
to programatically set the value of the cell using following code and did
not work. oSheet.Range["A1"].Value = "A1"; The same code works
for a regular cell. Looks like that the dropdown listitems were from
another sheet. Thanks very much for your help. Hugh As I mentioned
in your other thread.., the value you're trying to enter in a DV cell must
be in the DV List. Otherwise, it doesn't work! Try assigning one of the
list items! -- Garry Free uenet access at http://www.eternal-september.org
Classic VB Users Regroup comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



First, thanks very much for your help again. Yes, the value entered is one
of the DV list items. But it did not work. I must miss something here.
Please elaborate what you said, Gary. There is not like string.contains or
string.match function that can be used.


Sorry, Hugh, but I don't speak C#. I'm sure, though, that every
function available in VB[A] (and much more) is available in the .Net
languages in some way. Sorry I can't be of help with your syntax. My
hope is that you could convert my sample code...

--
Garry

Free uenet access at http://www.eternal-september.org
Classic VB Users Regroup
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion