Hi all, quick question.

Essentially, I am connecting to a web server through VBA, filling out a form by identifying the element names in the HTML of the webpage and posting the form to the site. That part works fine, and the report is generated on the screen. However, at that point, I'd like to be able to write some VBA code that will use the "Export" option on the webpage, in order to download the data for further manipulation.

The HTML code is below (side note: I hate whoever built this website for naming their page elements so nondescriptly....)

<table cellpadding="0" cellspacing="0" style="display:inline;">
					<tr>
						<td height="28px"><select name="rvReportsMain$ctl01$ctl05$ctl00" id="rvReportsMain_ctl01_ctl05_ctl00" title="Export Formats" onChange="document.getElementById('rvReportsMain_ctl01_ctl05_ctl01').Controller.SetViewerLinkActive(document.getElementById('rvReportsMain_ctl01_ctl05_ctl00').selectedIndex != 0);" style="font-family:Tahoma;font-size:8pt;">
							<option selected="selected" value="Select a format">Select a format</option>
							<option value="XML">XML file with report data</option>
							<option value="CSV">CSV (comma delimited)</option>
							<option value="PDF">Acrobat (PDF) file</option>
							<option value="MHTML">MHTML (web archive)</option>
							<option value="EXCEL">Excel</option>
							<option value="IMAGE">TIFF file</option>
							<option value="WORD">Word</option>

						</select></td><td width="4px"></td><td height="28px"><a id="rvReportsMain_ctl01_ctl05_ctl01" onclick="
var formatDropDown = document.getElementById('rvReportsMain_ctl01_ctl05_ctl00');
if (formatDropDown.selectedIndex == 0)
    return false;
window.open(document.getElementById('rvReportsMain').ClientController.m_exportUrlBase + encodeURIComponent(formatDropDown.value), '_blank')
formatDropDown.selectedIndex = 0;
document.getElementById('rvReportsMain_ctl01_ctl05_ctl01').Controller.SetViewerLinkActive(document.getElementById('rvReportsMain_ctl01_ctl05_ctl00').selectedIndex != 0);return false;" onmouseover="this.Controller.OnLinkHover();" onmouseout="this.Controller.OnLinkNormal();" title="Export" href="#" style="font-family:Tahoma;font-size:8pt;color:Gray;text-decoration:none;"><script type="text/javascript">
							document.getElementById('rvReportsMain_ctl01_ctl05_ctl01').Controller = new ReportViewerLink("rvReportsMain_ctl01_ctl05_ctl01", false, "", "", "#3366CC", "Gray", "#FF3300");
						</script>Export</a></td>
					</tr>
				</table>
			</div><table cellpadding="0" cellspacing="0" ToolbarSpacer="true" style="display:inline;">
				<tr>
					<td style="width:20px;"></td>
				</tr>
			</table>
Selecting the file format is easy....I want to download it in CSV format which is simply

.document.all("rvReportsMain$ctl01$ctl05$ctl00").Value = "CSV"
However, when I use the ".Click" property of the "Export" link (which is named rvReportsMain_ctl01_ctl05_ctl01), a new browser window and dialog box flash onto the screen briefly before disappearing. It's as if "Cancel" is the default setting for handling the dialog box, whereas I'd like it to "Save" the file, so I'm stuck at this point not knowing how to handle this problem.

The page uses Java functions, and I'm wondering if I'd need to somehow pass a parameter to one of the functions (perhaps "ReportViewerLink"?) in order to have it automatically download the file rather than cancelling. I'm also hoping there is an easy way to do this that doesn't require getting too technical with HTTPS and SSL connections....

Thanks in advance.