Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have the following code and I am trying to clear the values in a ListBox... If ActiveCell.Offset(i, 0) = "" Then VendorEntry_1280x1024.RuleListBox.Clear Exit Sub End If When the routine is executed it returns the following error message Run-time error '-2147467259 (80004005) Unspecified error. The routine does not continue or recover...can anyone assist with this one ? Thanks Scott |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi
Works for me when I run it from a command button on the userform. Where are you running this code from? Is the userform visible? Is it loaded? regards Paul On Feb 14, 8:22*am, scott56hannah wrote: Hi, I have the following code and I am trying to clear the values in a ListBox.... If ActiveCell.Offset(i, 0) = "" Then * * * * VendorEntry_1280x1024.RuleListBox.Clear * * * * Exit Sub End If When the routine is executed it returns the following error message Run-time error '-2147467259 (80004005) Unspecified error. The routine does not continue or recover...can anyone assist with this one ? Thanks Scott |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Paul,
Yes the form is visible and loaded....I am running the code from a "Refresh" button on the form...it is not working for me.... Interestingly it goes through the initial call when the form is first initialised and it runs this step....then after the list box is populated with values for the first time and then I try to refresh it returns this error Scott " wrote: hi Works for me when I run it from a command button on the userform. Where are you running this code from? Is the userform visible? Is it loaded? regards Paul On Feb 14, 8:22 am, scott56hannah wrote: Hi, I have the following code and I am trying to clear the values in a ListBox.... If ActiveCell.Offset(i, 0) = "" Then VendorEntry_1280x1024.RuleListBox.Clear Exit Sub End If When the routine is executed it returns the following error message Run-time error '-2147467259 (80004005) Unspecified error. The routine does not continue or recover...can anyone assist with this one ? Thanks Scott |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I can't reproduce your problem given the code snippet you posted. Perhaps it is another part of the code causing the problem? Paul On Feb 14, 12:28*pm, scott56hannah wrote: Paul, Yes the form is visible and loaded....I am running the code from a "Refresh" button on the form...it is not working for me.... Interestingly it goes through the initial call when the form is first initialised and it runs this step....then after the list box is populated with values for the first time and then I try to refresh it returns this error Scott " wrote: hi Works for me when I run it from a command button on the userform. Where are you running this code from? Is the userform visible? Is it loaded? regards Paul On Feb 14, 8:22 am, scott56hannah wrote: Hi, I have the following code and I am trying to clear the values in a ListBox.... If ActiveCell.Offset(i, 0) = "" Then * * * * VendorEntry_1280x1024.RuleListBox.Clear * * * * Exit Sub End If When the routine is executed it returns the following error message Run-time error '-2147467259 (80004005) Unspecified error. The routine does not continue or recover...can anyone assist with this one ? Thanks Scott- Hide quoted text - - Show quoted text - |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Paul,
Have now found the problem....for the Listbox I was assigning a Range value for the values to the RowSource property. If I clear that value by assigning a "" rather than use the .Clear action it clears all values from the list.....looking at some doco on list boxes if you assign a range you cannot delete or add items using the actions you must change the RowSource assignment... Thanks for your help Scott " wrote: Hi I can't reproduce your problem given the code snippet you posted. Perhaps it is another part of the code causing the problem? Paul On Feb 14, 12:28 pm, scott56hannah wrote: Paul, Yes the form is visible and loaded....I am running the code from a "Refresh" button on the form...it is not working for me.... Interestingly it goes through the initial call when the form is first initialised and it runs this step....then after the list box is populated with values for the first time and then I try to refresh it returns this error Scott " wrote: hi Works for me when I run it from a command button on the userform. Where are you running this code from? Is the userform visible? Is it loaded? regards Paul On Feb 14, 8:22 am, scott56hannah wrote: Hi, I have the following code and I am trying to clear the values in a ListBox.... If ActiveCell.Offset(i, 0) = "" Then VendorEntry_1280x1024.RuleListBox.Clear Exit Sub End If When the routine is executed it returns the following error message Run-time error '-2147467259 (80004005) Unspecified error. The routine does not continue or recover...can anyone assist with this one ? Thanks Scott- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Create a Clear button to clear unprotected cells | Excel Programming | |||
clear the clear the web page email attachment lines | Excel Discussion (Misc queries) | |||
Clear Cell using Listbox | Excel Programming | |||
Fast way to clear Listbox selection | Excel Programming | |||
How to Clear value a listbox! | Excel Programming |