line: 95
char: 10
error: Object required
code: 0
url: [ some url ]

I'm writing an application to log in to a website, select options and download files. I get this error when I try to select the options and simulate clicking the download button:

WebBrowser b = sender as WebBrowser;

IHTMLDocument2 doc = (IHTMLDocument2)b.Document.DomDocument as IHTMLDocument2;
IHTMLElementCollection collection = doc.all;

foreach (HTMLSelectElement select in collection.tags("select"))
{
list.Add(select);
response = select.innerText;
if (select.innerText.Contains("Select")) // make this more robust
select.selectedIndex = 2;
}

response = b.DocumentText;

//<input onclick="JavaScript:validateData('Download')" id="idlnkdownload" type="submit" value="Download" name="download" /></td>
b.Document.GetElementById("download").InvokeMember("click");

any insight?