andrewsw, on 18 February 2013 - 11:33 AM, said:
I hope that modi123_1 won't mind me re-quoting his earlier post, as he states it very well:
and, of course, we would need to see relevant code.
Quote
"this code does not work" - how? In what way? Is there an exception? If so what is the text and what line is the exception on? Is it not performing as expected? If so what is it doing/what results is it providing, and what were you expecting? The more you can tell us the better we are at helping you.
and, of course, we would need to see relevant code.
Here is my coding:
oSheet.Range("A5").Value = ComboBox1.SelectedItem.ToString()
oSheet.Range("A6").Value = ComboBox2.SelectedItem.ToString()
oSheet.Range("A7").Value = ComboBox3.SelectedItem.ToString()
oSheet.Range("A8").Value = ComboBox4.SelectedItem.ToString()
oSheet.Range("A9").Value = ComboBox5.SelectedItem.ToString()
oSheet.Range("A10").Value = ComboBox6.SelectedItem.ToString()
oSheet.Range("A11").Value = ComboBox7.SelectedItem.ToString()
oSheet.Range("A12").Value = ComboBox8.SelectedItem.ToString()
oSheet.Range("A13").Value = ComboBox11.SelectedItem.ToString()
oSheet.Range("A14").Value = ComboBox12.SelectedItem.ToString()
oSheet.Range("A15").Value = ComboBox13.SelectedItem.ToString()
oSheet.Range("A16").Value = ComboBox14.SelectedItem.ToString()
oSheet.Range("A17").Value = ComboBox10.SelectedItem.ToString()
oSheet.Range("A18").Value = ComboBox9.SelectedItem.ToString()
I want to be able to let a combo box or two be left blank at a stage when it is not in use. How can I get rid of the NullReferenceException?

New Topic/Question
Reply




MultiQuote







|