1

I have searched many websites to get the answer but could not succeeded.

I want to download xls file from my company website, and through VBA i was able to sign in and then change few parameter and lastly I clicked on export button. after clicking on export button xls file will be downloaded but then I got a pop up from internet explorer about save/save as/open.

So finally I am stuck here, I used send keys to download this but is there any other option which will save xls file in my defined path and pre defined xls name.

there is another problem that after clicking on export button xls file name can be any thing.

thanks so much in advance for your help.

Community
  • 1
  • 1
sunil
  • 23
  • 4

1 Answers1

1

I have had the same problem as you a few years back. Now I think using Internet Explorer with sendkeys is generally a bad idea. I have managed to solve my problem with a WinHttpRequest (without using IE).

Let me redirect you to a similar and solved question which might help you.

VBA WinHTTP to download file from password proteced https website

Community
  • 1
  • 1
handris
  • 1,999
  • 8
  • 27
  • 41
  • Hi Handris, but I don't have fileurl, because when I click on export button then file get started to download – sunil Dec 07 '15 at 14:31
  • 1
    You do have an url. Just download the xls file you need once in your browser. Check the downloads page and there you will find an url associated with your downloaded file. – handris Dec 07 '15 at 14:35
  • Hi Handris, its not working, I tried using file url but it created file with no data – sunil Dec 08 '15 at 08:29