ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel crash based on this action (https://www.excelbanter.com/excel-programming/389294-excel-crash-based-action.html)

matelot

Excel crash based on this action
 
I have a graph linked to a macro located in Module 1
sub graph_click
worksheets(2).activate
[A1] = "chartype"
end sub
On worksheet#2, I have a comboBox that I want the value to default to
"charttype" which is 1 of the drop down values. I first tried combobox1.value
= "charttype" and it didn't work. As a workaround, I update the cell that the
combobox is linked to in this case A1. However, after 2 clicks test on the
graph, my excel always crashed. Is it because I am not supposed to update the
cell that is linked to the combobox result?

Help

Dom_Ciccone

Excel crash based on this action
 
Try using the ListIndex property of the combobox to set the default value.
The first item in the list has a listindex number of 0. If your "charttype"
value is the 3rd irem in the list, you would use a ListIndex value of 2.

eg:

sub graph_click
worksheets(2).activate
ComboBox1.ListIndex = 2
end sub


"matelot" wrote:

I have a graph linked to a macro located in Module 1
sub graph_click
worksheets(2).activate
[A1] = "chartype"
end sub
On worksheet#2, I have a comboBox that I want the value to default to
"charttype" which is 1 of the drop down values. I first tried combobox1.value
= "charttype" and it didn't work. As a workaround, I update the cell that the
combobox is linked to in this case A1. However, after 2 clicks test on the
graph, my excel always crashed. Is it because I am not supposed to update the
cell that is linked to the combobox result?

Help


matelot

Excel crash based on this action
 
Thanks. That seems to fix the problem. No more crashes.

"Dom_Ciccone" wrote:

Try using the ListIndex property of the combobox to set the default value.
The first item in the list has a listindex number of 0. If your "charttype"
value is the 3rd irem in the list, you would use a ListIndex value of 2.

eg:

sub graph_click
worksheets(2).activate
ComboBox1.ListIndex = 2
end sub


"matelot" wrote:

I have a graph linked to a macro located in Module 1
sub graph_click
worksheets(2).activate
[A1] = "chartype"
end sub
On worksheet#2, I have a comboBox that I want the value to default to
"charttype" which is 1 of the drop down values. I first tried combobox1.value
= "charttype" and it didn't work. As a workaround, I update the cell that the
combobox is linked to in this case A1. However, after 2 clicks test on the
graph, my excel always crashed. Is it because I am not supposed to update the
cell that is linked to the combobox result?

Help



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com