Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
EXCEL 2007 - DATA VALIDATION LIST | Excel Discussion (Misc queries) | |||
Excel 2003. Data/Validation/Settings - Allow/List: sizing list? | Excel Discussion (Misc queries) | |||
Excel 07 / Data Validation / List / | Excel Worksheet Functions | |||
How do I make a Validation List in Excel, using data on a second | Excel Discussion (Misc queries) | |||
Excel, Data Validation List | Excel Discussion (Misc queries) |