• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Save attachments from IE to specified folder|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Save attachments from IE to specified folder|VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosSave attachments from IE to specifi…
sp_PrintTopic sp_TopicIcon
Save attachments from IE to specified folder
Avatar
Rajsha B
India
Member
Members
Level 0
Forum Posts: 22
Member Since:
April 7, 2020
sp_UserOfflineSmall Offline
1
April 14, 2020 - 8:13 pm
sp_Permalink sp_Print sp_EditHistory
I need help with clicking a button using vba to download the files, Here are the steps what I'm trying to do:
 
Log in web site: aaa.com (due to restriction i cant provide site details.)
download attachments from the "download attachments" button
Save the files(all files - any format) to specified path with folder name as provided in Sheet1 of "A" column

 

This is the html code for the button:

Download 36 Attachments

All the attachments should be downloaded to specific folder with Order number as a folder name. Order numbers are listed in Column A of the Sheet1 (based on Order number we ill search the results)

I found this piece of code... 


Sub AANs()
Dim Dates As Object, Matters As Object, i As Long,
Ws
As Worksheet
Dim L As Long
Lr As Long Dim Html As MSHTML.HTMLDocument
Lr1
= ThisWorkbook.Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
Dim ie As New InternetExplorer
'SETTING IE FOR Order NUMBERS
For L = 2 To Lr1
Set Ws = ActiveWorkbook.Sheets("Sheet2")
Set ie = New InternetExplorer ie.navigate www.abc.com/sc/wo/index?id=" & _ ThisWorkbook.Sheets("Sheet1").Range("A" & L)
ie.Visible = True Application.Wait Now + TimeValue("00:00:05")
Set Html = New MSHTML.HTMLDocument
Html.body.innerHTML = ie.document.querySelectorAll(".btn btn-default")
Set Dates = Html.querySelectorAll(".wo-attachments-link") < 
GOT stuck here
Any Help please
Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1514
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
2
April 15, 2020 - 9:50 am
sp_Permalink sp_Print

Hi Rajsha,

Never done this with VBA, I have to wonder why you are using Excel to do this?  Doesn't seem the like the best tool.

You could try using Selenium https://www.myonlinetraininghu.....ng-forms 

Then by clicking the download button the file will download. 

Driver.FindElementById("download-button-ID").Click

You may need to set some preferences in Chrome to save without asking you to save the file.

If you were to use Python it would be easier.

Regards

Phil

Avatar
Rajsha B
India
Member
Members
Level 0
Forum Posts: 22
Member Since:
April 7, 2020
sp_UserOfflineSmall Offline
3
April 15, 2020 - 4:37 pm
sp_Permalink sp_Print
Hi Philip Treacy, 
 
 I thought to reach you on this query, but i couldn't find the way to reach you. so i asked the query once. Last time you suggested me two sites which you posted. Those where help full but the think i'm struggling is we don't have access to "Selenium" or Python. That's the reason i'm trying to using VBA to get the result. And more over I don't have knowledge on this platforms which you suggested. Sorry for giving trouble. Thanks for your reply.
 
Rajsha
Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1514
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
4
April 15, 2020 - 5:32 pm
sp_Permalink sp_Print

Hi Rajsha,

OK, not sure why you don't have access to Selenium or Python, they are both free.  As I'm not familiar with your environment or the restrictions on it I'm a bit stuck as to offer assistance.

Phil

Avatar
Rajsha B
India
Member
Members
Level 0
Forum Posts: 22
Member Since:
April 7, 2020
sp_UserOfflineSmall Offline
5
April 15, 2020 - 11:54 pm
sp_Permalink sp_Print sp_EditHistory

Hi Philip,

I just what to know with you, how to send specific mail to you directly. Could you please let me know once if i want to check with you in regarding with this query back again. 

 

Thanks

Rajsha

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1514
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
6
April 16, 2020 - 9:23 am
sp_Permalink sp_Print

Hi Rajsha,

You can contact me via this forum.

Regards

Phil

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: MohamedGadAllah, Jeff Krueger, Kylara Papenfuss, Janset Beyaz, Shawn Barwick, Nada Perovic
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
John Chisholm
vexokeb sdfg
John Jack
Malcolm Toy
Ray-Yu Yang
George Shihadeh
Naomi Rumble
Uwe von Gostomski
Jonathan Jones
drsven
Forum Stats:
Groups: 3
Forums: 24
Topics: 6212
Posts: 27236

 

Member Stats:
Guest Posters: 49
Members: 31889
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.