Problem with Workbook_Open

G

Guest

Hi,

I want to setup one ComboBox per WorkSheet at startup.
For this I have the following code:
Private Sub Workbook_open()
Worksheets("I_Calc").ComboBox1.List = Array("Alfa", "Beta", "Gamma",
"Delta")
Worksheets("I_Calc").ComboBox1.Value = "Gamma"
Worksheets("V_Calc").ComboBox1.List = Array("Alfa", "Beta", "Gamma",
"Delta")
Worksheets("V_Calc").ComboBox1.Value = "Gamma"
Worksheets("F_Calc").ComboBox1.List = Array("Alfa", "Beta", "Gamma",
"Delta")
Worksheets("F_Calc").ComboBox1.Value = "Gamma"
Worksheets("T_Calc").ComboBox1.List = Array("Alfa", "Beta", "Gamma",
"Delta")
Worksheets("T_Calc").ComboBox1.Value = "Gamma"
End Sub

But when I start up the file I get "Permission denied (Error 70)" at line 4.
The setup of the ComboBox1 at WorkSheet(I_Calc) is done correctly by the code.
But for the other WorkSheets it does not work.

What have I done wrong?
I have checked the name of the ComboBoxes and all of them is called ComboBox1.

Br.
/Sören
 
N

Norman Jones

Hi Sören,

I could replicate your error if I had set the relevant
ComboBox ListFillRrange property value.
 
G

Guest

Japp, there were already data in the ListFillRange.
When I remove it the Workbook_Open macro works.

Thanks!

Br.
/Sören
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top