Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Clear Method not working for a ListBox clear

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Clear Method not working for a ListBox clear

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Clear Method not working for a ListBox clear

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Clear Method not working for a ListBox clear

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Clear Method not working for a ListBox clear

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
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
Create a Clear button to clear unprotected cells Jcraig713 Excel Programming 2 November 26th 07 03:55 PM
clear the clear the web page email attachment lines MCrider Excel Discussion (Misc queries) 0 November 11th 07 10:05 PM
Clear Cell using Listbox cluck Excel Programming 0 April 28th 06 07:45 PM
Fast way to clear Listbox selection [email protected] Excel Programming 4 August 26th 05 10:09 PM
How to Clear value a listbox! bookworm98[_6_] Excel Programming 5 January 27th 04 04:38 AM


All times are GMT +1. The time now is 02:24 PM.

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

About Us

"It's about Microsoft Excel"