I have tried using the macro recorder to change the value of a combobox without success.
wb0.Sheets("Report").OLEObjects.ComboBox1.Value = Format(strDate, "dd mmmm yyyy")
Can anyone see where am I going wrong with my syntax?
Change value of combobox
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Change value of combobox
Nathan
There's no place like home.....
There's no place like home.....
-
- Administrator
- Posts: 79539
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Change value of combobox
Does this work?
wb0.Sheets("Report").OLEObjects("ComboBox1").Value = Format(strDate, "dd mmmm yyyy")
wb0.Sheets("Report").OLEObjects("ComboBox1").Value = Format(strDate, "dd mmmm yyyy")
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Re: Change value of combobox
No.
It's a combo box from the control toolbox.
It's a combo box from the control toolbox.
Nathan
There's no place like home.....
There's no place like home.....
-
- Administrator
- Posts: 79539
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Change value of combobox
Sorry, forgot an essential part:
wb0.Sheets("Report").OLEObjects("ComboBox1").Object.Value = Format(strDate, "dd mmmm yyyy")
wb0.Sheets("Report").OLEObjects("ComboBox1").Object.Value = Format(strDate, "dd mmmm yyyy")
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.