Set wks = wkb.Worksheets("Calendar") 'active worksheet
wks.Cells(NextRow, 1) = ComboBox1.Value
I have this two lines of code with me. Here it gives me an error number 1004
when I am going to assign the value of combobox to the worksheet's(wks) first cell.
Let me know some resolution....
Advance Thanks....
Runtime Error 1004 usually means that you are referring to an object that does not exist in your workbook.
As in your case
wks.Cells(NextRow, 1) = ComboBox1.Value
check the value of variable NextRow and make sure its greater than 0 to avoid the issue.Also check wks workbook is valid workbook object.
This issue may occur if either of the following conditions is true:
The Runtime error 1004 means:
Reference: http://support.microsoft.com/kb/905164