Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Listbox - works 1/2 time

Hi,

I have some option buttons (for now, Opt1 and Opt2), a listbox (ListBox1)
and a command button (Cmd1) on a worksheet. Here is the very basic code I
have reduced the option buttons to in trying to debug my issue...

Private Sub Opt1_Click()
ListBox1.Visible = False
Cmd1.Visible - False
End Sub

Private Sub Opt2_Click()
ListBox1.Visible = True
Cmd1.Visible = True
End Sub


When I click Opt1, the list box is not visible. When I then click Opt2, the
list box is visible and shows the info I expect. The problem is that I am
unable to select any rows in the list, or scroll down the list. The command
button works as coded (including error hanndling for no selection in the
list).

Then, I click Opt1 again, the list is hidden, followed by Opt2, the list is
now visible again. This time however, I can now select rows in the list, etc.

This pattern repeats, so that if click Opt1, then Opt2 again, I will not be
able to use the listbox, and then I can. I have checked that the list box
is always set to enabled, that the worksheet itself is not protected, and
looked for other settings that I thought might be causing this. I am using
Excel 2000.

Anyone know why this would happen?

Thanks!




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Listbox - works 1/2 time

Why do you have a minus sign in the 1st macro?

"BigJimmer" wrote:

Hi,

I have some option buttons (for now, Opt1 and Opt2), a listbox (ListBox1)
and a command button (Cmd1) on a worksheet. Here is the very basic code I
have reduced the option buttons to in trying to debug my issue...

Private Sub Opt1_Click()
ListBox1.Visible = False
Cmd1.Visible - False
End Sub

Private Sub Opt2_Click()
ListBox1.Visible = True
Cmd1.Visible = True
End Sub


When I click Opt1, the list box is not visible. When I then click Opt2, the
list box is visible and shows the info I expect. The problem is that I am
unable to select any rows in the list, or scroll down the list. The command
button works as coded (including error hanndling for no selection in the
list).

Then, I click Opt1 again, the list is hidden, followed by Opt2, the list is
now visible again. This time however, I can now select rows in the list, etc.

This pattern repeats, so that if click Opt1, then Opt2 again, I will not be
able to use the listbox, and then I can. I have checked that the list box
is always set to enabled, that the worksheet itself is not protected, and
looked for other settings that I thought might be causing this. I am using
Excel 2000.

Anyone know why this would happen?

Thanks!




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Listbox - works 1/2 time

It's a typo in my post.
"Joel" wrote:

Why do you have a minus sign in the 1st macro?

"BigJimmer" wrote:

Hi,

I have some option buttons (for now, Opt1 and Opt2), a listbox (ListBox1)
and a command button (Cmd1) on a worksheet. Here is the very basic code I
have reduced the option buttons to in trying to debug my issue...

Private Sub Opt1_Click()
ListBox1.Visible = False
Cmd1.Visible - False
End Sub

Private Sub Opt2_Click()
ListBox1.Visible = True
Cmd1.Visible = True
End Sub


When I click Opt1, the list box is not visible. When I then click Opt2, the
list box is visible and shows the info I expect. The problem is that I am
unable to select any rows in the list, or scroll down the list. The command
button works as coded (including error hanndling for no selection in the
list).

Then, I click Opt1 again, the list is hidden, followed by Opt2, the list is
now visible again. This time however, I can now select rows in the list, etc.

This pattern repeats, so that if click Opt1, then Opt2 again, I will not be
able to use the listbox, and then I can. I have checked that the list box
is always set to enabled, that the worksheet itself is not protected, and
looked for other settings that I thought might be causing this. I am using
Excel 2000.

Anyone know why this would happen?

Thanks!




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Listbox - works 1/2 time

Just a guess...

I think it's a display problem. Have you tried minimizing and maximizing the
application window--or scrolling up or down. Or toggling screenupdating off
then on in your code?

Sometimes, that kind of stuff helps.

BigJimmer wrote:

Hi,

I have some option buttons (for now, Opt1 and Opt2), a listbox (ListBox1)
and a command button (Cmd1) on a worksheet. Here is the very basic code I
have reduced the option buttons to in trying to debug my issue...

Private Sub Opt1_Click()
ListBox1.Visible = False
Cmd1.Visible - False
End Sub

Private Sub Opt2_Click()
ListBox1.Visible = True
Cmd1.Visible = True
End Sub

When I click Opt1, the list box is not visible. When I then click Opt2, the
list box is visible and shows the info I expect. The problem is that I am
unable to select any rows in the list, or scroll down the list. The command
button works as coded (including error hanndling for no selection in the
list).

Then, I click Opt1 again, the list is hidden, followed by Opt2, the list is
now visible again. This time however, I can now select rows in the list, etc.

This pattern repeats, so that if click Opt1, then Opt2 again, I will not be
able to use the listbox, and then I can. I have checked that the list box
is always set to enabled, that the worksheet itself is not protected, and
looked for other settings that I thought might be causing this. I am using
Excel 2000.

Anyone know why this would happen?

Thanks!


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Listbox - works 1/2 time

Application.ScreenUpdating was one of the first things I checked as I use
that frequently.

I just tried scrolling, and minimizing/maximizing the screen and neither of
those had any impact.

"Dave Peterson" wrote:

Just a guess...

I think it's a display problem. Have you tried minimizing and maximizing the
application window--or scrolling up or down. Or toggling screenupdating off
then on in your code?

Sometimes, that kind of stuff helps.

BigJimmer wrote:

Hi,

I have some option buttons (for now, Opt1 and Opt2), a listbox (ListBox1)
and a command button (Cmd1) on a worksheet. Here is the very basic code I
have reduced the option buttons to in trying to debug my issue...

Private Sub Opt1_Click()
ListBox1.Visible = False
Cmd1.Visible - False
End Sub

Private Sub Opt2_Click()
ListBox1.Visible = True
Cmd1.Visible = True
End Sub

When I click Opt1, the list box is not visible. When I then click Opt2, the
list box is visible and shows the info I expect. The problem is that I am
unable to select any rows in the list, or scroll down the list. The command
button works as coded (including error hanndling for no selection in the
list).

Then, I click Opt1 again, the list is hidden, followed by Opt2, the list is
now visible again. This time however, I can now select rows in the list, etc.

This pattern repeats, so that if click Opt1, then Opt2 again, I will not be
able to use the listbox, and then I can. I have checked that the list box
is always set to enabled, that the worksheet itself is not protected, and
looked for other settings that I thought might be causing this. I am using
Excel 2000.

Anyone know why this would happen?

Thanks!


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Listbox - works 1/2 time

If you swap to a different application, does it help?

If you close (saving your file) and reopen, does it work ok?

If you close excel and reopen the file, does it work ok?

If you fiddle with the windows display settings (lowering the hardware
acceleration), does it work ok?

If you change video drivers--or test on a different pc, does it work ok?

That's right, I don't have a guess!

BigJimmer wrote:

Application.ScreenUpdating was one of the first things I checked as I use
that frequently.

I just tried scrolling, and minimizing/maximizing the screen and neither of
those had any impact.

"Dave Peterson" wrote:

Just a guess...

I think it's a display problem. Have you tried minimizing and maximizing the
application window--or scrolling up or down. Or toggling screenupdating off
then on in your code?

Sometimes, that kind of stuff helps.

BigJimmer wrote:

Hi,

I have some option buttons (for now, Opt1 and Opt2), a listbox (ListBox1)
and a command button (Cmd1) on a worksheet. Here is the very basic code I
have reduced the option buttons to in trying to debug my issue...

Private Sub Opt1_Click()
ListBox1.Visible = False
Cmd1.Visible - False
End Sub

Private Sub Opt2_Click()
ListBox1.Visible = True
Cmd1.Visible = True
End Sub

When I click Opt1, the list box is not visible. When I then click Opt2, the
list box is visible and shows the info I expect. The problem is that I am
unable to select any rows in the list, or scroll down the list. The command
button works as coded (including error hanndling for no selection in the
list).

Then, I click Opt1 again, the list is hidden, followed by Opt2, the list is
now visible again. This time however, I can now select rows in the list, etc.

This pattern repeats, so that if click Opt1, then Opt2 again, I will not be
able to use the listbox, and then I can. I have checked that the list box
is always set to enabled, that the worksheet itself is not protected, and
looked for other settings that I thought might be causing this. I am using
Excel 2000.

Anyone know why this would happen?

Thanks!


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Listbox - works 1/2 time

Changing application, closing reopening the file/Excel, nothing was making a
difference. I didn't have the chance for trying other PCs yet, and an idea
occurred to me.

In my routine for displaying the list box, I now have the following , which
i don't like from a proramming perspective, though it has resolved the issue
until someone else can provde a better solution...

with ListBox1
.Visible = True
.Visible = False
.Visble = True
end with



"Dave Peterson" wrote:

If you swap to a different application, does it help?

If you close (saving your file) and reopen, does it work ok?

If you close excel and reopen the file, does it work ok?

If you fiddle with the windows display settings (lowering the hardware
acceleration), does it work ok?

If you change video drivers--or test on a different pc, does it work ok?

That's right, I don't have a guess!

BigJimmer wrote:

Application.ScreenUpdating was one of the first things I checked as I use
that frequently.

I just tried scrolling, and minimizing/maximizing the screen and neither of
those had any impact.

"Dave Peterson" wrote:

Just a guess...

I think it's a display problem. Have you tried minimizing and maximizing the
application window--or scrolling up or down. Or toggling screenupdating off
then on in your code?

Sometimes, that kind of stuff helps.

BigJimmer wrote:

Hi,

I have some option buttons (for now, Opt1 and Opt2), a listbox (ListBox1)
and a command button (Cmd1) on a worksheet. Here is the very basic code I
have reduced the option buttons to in trying to debug my issue...

Private Sub Opt1_Click()
ListBox1.Visible = False
Cmd1.Visible - False
End Sub

Private Sub Opt2_Click()
ListBox1.Visible = True
Cmd1.Visible = True
End Sub

When I click Opt1, the list box is not visible. When I then click Opt2, the
list box is visible and shows the info I expect. The problem is that I am
unable to select any rows in the list, or scroll down the list. The command
button works as coded (including error hanndling for no selection in the
list).

Then, I click Opt1 again, the list is hidden, followed by Opt2, the list is
now visible again. This time however, I can now select rows in the list, etc.

This pattern repeats, so that if click Opt1, then Opt2 again, I will not be
able to use the listbox, and then I can. I have checked that the list box
is always set to enabled, that the worksheet itself is not protected, and
looked for other settings that I thought might be causing this. I am using
Excel 2000.

Anyone know why this would happen?

Thanks!

--

Dave Peterson


--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Listbox - works 1/2 time

You know what they call an ugly fix?

A Fix!!!

I'd use it <vbg.

BigJimmer wrote:

Changing application, closing reopening the file/Excel, nothing was making a
difference. I didn't have the chance for trying other PCs yet, and an idea
occurred to me.

In my routine for displaying the list box, I now have the following , which
i don't like from a proramming perspective, though it has resolved the issue
until someone else can provde a better solution...

with ListBox1
.Visible = True
.Visible = False
.Visble = True
end with

"Dave Peterson" wrote:

If you swap to a different application, does it help?

If you close (saving your file) and reopen, does it work ok?

If you close excel and reopen the file, does it work ok?

If you fiddle with the windows display settings (lowering the hardware
acceleration), does it work ok?

If you change video drivers--or test on a different pc, does it work ok?

That's right, I don't have a guess!

BigJimmer wrote:

Application.ScreenUpdating was one of the first things I checked as I use
that frequently.

I just tried scrolling, and minimizing/maximizing the screen and neither of
those had any impact.

"Dave Peterson" wrote:

Just a guess...

I think it's a display problem. Have you tried minimizing and maximizing the
application window--or scrolling up or down. Or toggling screenupdating off
then on in your code?

Sometimes, that kind of stuff helps.

BigJimmer wrote:

Hi,

I have some option buttons (for now, Opt1 and Opt2), a listbox (ListBox1)
and a command button (Cmd1) on a worksheet. Here is the very basic code I
have reduced the option buttons to in trying to debug my issue...

Private Sub Opt1_Click()
ListBox1.Visible = False
Cmd1.Visible - False
End Sub

Private Sub Opt2_Click()
ListBox1.Visible = True
Cmd1.Visible = True
End Sub

When I click Opt1, the list box is not visible. When I then click Opt2, the
list box is visible and shows the info I expect. The problem is that I am
unable to select any rows in the list, or scroll down the list. The command
button works as coded (including error hanndling for no selection in the
list).

Then, I click Opt1 again, the list is hidden, followed by Opt2, the list is
now visible again. This time however, I can now select rows in the list, etc.

This pattern repeats, so that if click Opt1, then Opt2 again, I will not be
able to use the listbox, and then I can. I have checked that the list box
is always set to enabled, that the worksheet itself is not protected, and
looked for other settings that I thought might be causing this. I am using
Excel 2000.

Anyone know why this would happen?

Thanks!

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
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
Fill a multicolumn listbox with data from a range in another works Dale Fye Excel Programming 1 October 12th 07 06:58 PM
It works .... but only 1 time JeroenM Excel Programming 0 July 12th 07 08:40 AM
Works every second time hih Excel Programming 2 January 20th 06 06:06 PM
CopyPicture only works second time AllanS Excel Programming 2 September 20th 05 01:32 PM
listbox works in form; not imbedded??? jasonsweeney[_66_] Excel Programming 3 April 15th 04 10:24 PM


All times are GMT +1. The time now is 05:26 AM.

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"