Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default putting data from hashtable into Excel Validation list


Hello ,

I am having trouble with inserting my data in a dropdown list in Exce
using C#. I am inserting the data from an array into a hashtable the
putting them all together in a string variable comma delimited. Usin
this exact same code with a DataTable previously worked very well, bu
now with this array I am receiving the Exception from HRESULT
0X800A03EC error after running the code and Excel opening up. Anyway
Here is the code I wrote if anyone can help me I will appreciate i
greatly:

private void PutWkDateInXL()
{
DisableWorkSheetChanges = true;
int i;
try
{
ThisApplication.ScreenUpdating = false;
for (i = strWkEnd.GetLowerBound(0); i <= strWkEnd.GetUpperBound(0)
i++)
{
strWkDate = strWkEnd[i].ToString();
// save the dates.
UpdateInfos = new UpdateInfo();
UpdateInfos.SetDate(strWkDate);
// add DATES to hashtable.
DateListHash.Add(UpdateInfos.GetDate(), UpdateInfos);
strDateList += UpdateInfos.GetDate() + ", ";
}
test();
}
finally
{
ThisApplication.ScreenUpdating = true;
DisableWorkSheetChanges = false;
}
}
private void test()
{
try
{
rngUC.get_Offset(0,0).Validation.Add(Excel.XlDVTyp e.xlValidateList,
Excel.XlDVAlertStyle.xlValidAlertStop,
Excel.XlFormatConditionOperator.xlBetween,
strDateList,"");//stops here
rngUC.get_Offset(0,0).Validation.IgnoreBlank = true;
rngUC.get_Offset(0,0).Validation.InCellDropdown = true;
rngUC.get_Offset(0,0).Validation.InputMessage = strInputMessage;
rngUC.get_Offset(0,0).Validation.ShowInput = true;
rngUC.get_Offset(0,0).Value2 = strInputMessage;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, ex.Source, MessageBoxButtons.OK
MessageBoxIcon.Error);
}
}
Also, the array is allocated to 1148 locations and the data consists o
weekending dates. And, the range value is also indicating <cannot vie
indexed property

--
Ars
-----------------------------------------------------------------------
Arsi's Profile: http://www.excelforum.com/member.php...fo&userid=1573
View this thread: http://www.excelforum.com/showthread.php?threadid=27250

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
EXCEL 2007 - DATA VALIDATION LIST Asoka Walpitagama - Brandix College IT Excel Discussion (Misc queries) 1 November 18th 09 02:28 PM
Excel 2003. Data/Validation/Settings - Allow/List: sizing list? Bart Excel Discussion (Misc queries) 1 February 20th 09 01:40 PM
Excel 07 / Data Validation / List / WSR Excel Worksheet Functions 1 September 8th 08 03:26 PM
How do I make a Validation List in Excel, using data on a second Driver Excel Discussion (Misc queries) 2 February 23rd 06 01:30 PM
Excel, Data Validation List Ken H Excel Discussion (Misc queries) 1 March 1st 05 05:28 PM


All times are GMT +1. The time now is 10:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"