How to Give SaveAs in I.E

0

I have a problem downloading a file via vba, because as I can open the document (pdf format) I can save it with name and location quietly, but how much it does not open in the browser itself, when it is a .doc file it opens only the tab below.

IcandownloaditbypressingSavewithSendKeys,codebelow:

Application.SendKeys"%(s)"

But I can not determine the path and location, I would like to know if you have access to the down arrow and choose Save As, so I can determine the save location and name.

I have tried to save the file through the URL but it is not possible because the site has a block for this type of operation.

    
asked by anonymous 02.10.2017 / 15:49

1 answer

0

For IE11 or later, this should work:

  • Shortcut key: Alt + S

  • VBA: Application.SendKeys "%{S}" (notice the use of the keys)

If it still does not work, try adding this variable in the code:

Dim Report As Variant

Report = Application.GetSaveAsFilename("Attrition Report.xls", "Excel Files (*.xls), *.xls")

Source: link

    
03.10.2017 / 05:32