• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Code with shortcut to export file from WIE8

Hi All,

I am facing a challenge in saving my time as i have to use IE8 to get excel 07 file, Is there any way to create a macro, so that whenever i use shortcut and in result it export the file from a website (on line tool of my company).

Many thanks in advance.

Regards
 
Hi,

try to adapt this code to your needs :
Code:
Private Declare Function URLDownloadToFile& Lib "urlmon" Alias "URLDownloadToFileA" _
    (ByVal pCaller&, ByVal szURL$, ByVal szFileName$, ByVal dwReserved&, ByVal lpfnCB&)
 
 
Function DownloadFile(URL$, LocalFilename$) As Boolean
         DownloadFile = URLDownloadToFile(0, URL, LocalFilename, 0, 0) = 0
End Function
 
 
Sub DownloadDemo()
        Const UNC$ = "C:\Download\"
 
         Filename$ = "page.html"
             sURL$ = "http://website/" & Filename
    LocalFilename$ = UNC & Filename
 
    Debug.Print DownloadFile(sURL, LocalFilename)
End Sub
 
Back
Top