ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   "File Download" dialog box (https://www.excelbanter.com/excel-programming/361132-file-download-dialog-box.html)

Brian Delaney

"File Download" dialog box
 
Hi,

Can anyone please tell me how to programatically click the "Open" button in
an IE "File Download" dialog box?

(Is the dialog box an object of the IE document? the window? I'm baffled.)

Thanks in advance.

Brian



David McRitchie

"File Download" dialog box
 
Hi Brian,
see Dialog Boxes in VBA
http://www.mvps.org/dmcritchie/excel...g.htm#openfile
--
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Brian Delaney" wrote in message ...
Hi,

Can anyone please tell me how to programatically click the "Open" button in
an IE "File Download" dialog box?

(Is the dialog box an object of the IE document? the window? I'm baffled.)

Thanks in advance.

Brian





BPD

"File Download" dialog box
 
David, thanks for the tip. However the dialog box I'm trying to
identify/manipulate is not an Excel db. Rather, it's the "File
Download" db that pops up in an Internet Explorer window when trying to
download a file from a site, giving the options (via buttons) to Open
or Save the file or Cancel the download.

Again, I can't figure out what object hierarchy the db belongs to (IE,
Shell, ShellWindows?), or is it even an object at all?

Currently, I'm opening the file using Sendkeys and sending "O" to click
the Open button, but I hate having to rely on Sendkeys.

Any further help and/or direction you can point me in is much
appreciated.

Thanks,

Brian


sheetjo

"File Download" dialog box
 
Hi,
Please try the following link.it might help:
http://www.webdeveloper.com/forum/sh...d.php?t=104022

Add following code to your web page
Set objStream = Server.CreateObject("ADODB.Stream")
With objStream
..Open
..Type = 1
..LoadFromFile (server.MapPath(StrFilePath))'Full Physical Path to File
End with
With Response
..Clear
..AddHeader "Content-Disposition", "attachment; filename=" & StrFile & ""
'Filename
..Charset = "UTF-8"
..ContentType = "application/save"
..BinaryWrite objStream.Read
..Flush
End With
objStream.Close
set objStream = nothing

"BPD" wrote:

David, thanks for the tip. However the dialog box I'm trying to
identify/manipulate is not an Excel db. Rather, it's the "File
Download" db that pops up in an Internet Explorer window when trying to
download a file from a site, giving the options (via buttons) to Open
or Save the file or Cancel the download.

Again, I can't figure out what object hierarchy the db belongs to (IE,
Shell, ShellWindows?), or is it even an object at all?

Currently, I'm opening the file using Sendkeys and sending "O" to click
the Open button, but I hate having to rely on Sendkeys.

Any further help and/or direction you can point me in is much
appreciated.

Thanks,

Brian




All times are GMT +1. The time now is 06:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com