在IE中下载variables文件名,没有保存提示

我试图下载一个电子表格,每次访问时加载临时文件名称都会改变,而不用处理IE保存提示。 Intranet站点通过一个门户路由,这需要Windows身份validation才能login到我的目的地。 到目前为止,我拼凑在一起让我通过Windows身份validation,input适当的信息,然后单击button来检索查询。 理想情况下,我想直接将信息,而不保存提示,我的N:驱动器,并将其简单地保存为“File.xlsx”; 导航的下载/保存提示也可以,但我不知道哪一个会更容易或更有效地完成。

Sub Automation() Const URL1 = "https://website/q/?ICAction=ICQryNameExcelURL=PUBLIC.Z_FILE_DESIGN" Dim IE As New SHDocVw.InternetExplorer Dim HTMLDoc As HTMLDocument Dim DValue As String Set IE = New SHDocVw.InternetExplorerMedium DValue = Format(Date, "mm/dd/yyyy") With IE .Navigate URL1 .Visible = True End With Do DoEvents Loop Until IE.ReadyState = 4 And Not IE.Busy IE.Navigate "javascript: signinIWA();" Do DoEvents Loop Until IE.ReadyState = 4 And Not IE.Busy Set HTMLDoc = IE.Document HTMLDoc.getElementById("InputKeys_Z_File").Value = "q32e751" HTMLDoc.getElementById("InputKeys_EFFDT").Value = DValue Do DoEvents Loop Until IE.ReadyState = 4 And Not IE.Busy HTMLDoc.getElementById("#ICQryDownloadExcelFrmPrompt").Click End Sub 

如果有帮助,检查点击button元素时的代码:

 </DIV></td> </tr> <input type='hidden' name='ICExcel' id='ICExcel' value='1' /> </table> <a class='PSPUSHBUTTON' style='background-Color: transparent;border:0;' id = 'Left' role='presentation'><span style='background-Color: transparent;border:0;'><input type='button' class='PSPUSHBUTTON' value='View Results' id='#ICQryDownloadExcelFrmPrompt' onclick="submitAction_win4(this.form,'#ICQryDownloadExcelFrmPrompt');" tabindex='14' /></span></a> </DIV> <DIV id='win4divQUERYRESULT'><table cellpadding='2' cellspacing='0' width='90%'> <tr><td> </td></tr> <tr><td>` 

每次访问都会改变的是在onclick动作和queryresult行之后的数字“4”。 而且,当临时文件被打开时,它总是具有相同的基本名称 – Z_FILE_DESIGN,但是包含一个附加的随机数,例如。 Z_FILE_DESIGN_12345。 任何build议或协助,不胜感激。