Excel VBA Introduction Part 49 - Downloading Files from Websites

  Рет қаралды 96,634

WiseOwlTutorials

WiseOwlTutorials

Күн бұрын

Пікірлер: 196
@starlord5554
@starlord5554 3 жыл бұрын
This is "THE BEST" video available on the internet.The way he explains things is just REMARKABLE. Not only he covers the entire vba concept from MICROSOFT if not way too oo better. . "BHUTH CHUKRIA" - A big thank you from India. You are THE BEST
@WiseOwlTutorials
@WiseOwlTutorials 3 жыл бұрын
Thank you for the lovely comment!
@chamberlianferreira4578
@chamberlianferreira4578 6 ай бұрын
YEARS LATER AND YOUR ARE STILL, SIMPLY THE BEST!!!! Don't how I can thank you more!
@WiseOwlTutorials
@WiseOwlTutorials 6 ай бұрын
Happy that the video helped, thanks for watching!
@szilkov
@szilkov 3 жыл бұрын
Wow! Thank you! This was exactly what I needed to finalise a roughly 90 min task to one click and 53 seconds. Easy to understand, easy to follow self explanatory instructions.
@WiseOwlTutorials
@WiseOwlTutorials 3 жыл бұрын
Happy to hear that you found it useful, thanks for watching and for taking the time to leave a comment!
@charliesk6239
@charliesk6239 5 жыл бұрын
This is Gold, Boss - without a doubt. Many thanks Mr. Gould Sir. I much appreciate the depth you go into to make the app complete and to cover so many bases.
@maurocastagnera8949
@maurocastagnera8949 7 жыл бұрын
Dear Andrew, I still can not understand all that you teach, either because I do not understand your language very well and because I'm still at a basic level with VBA, but one thing I've known very well for a long time is that you're really a genius! When I look at your videos and understand the extraordinary talent you have, I keep thinking about how important people like you are, thanks to which the community can learn and advance in its knowledge. God bless you and make you get all the success you deserve in your professional life. My deep appreciation and gratitude comes to you.
@slicedbreadgames131
@slicedbreadgames131 5 жыл бұрын
He sure is Boss!
@SuperChikna
@SuperChikna 4 жыл бұрын
Very helpful. I am new to Macro and only needed to see this till 20:44 to get a hang of it. Thanks Team.
@andresff0
@andresff0 5 жыл бұрын
Andrew, again, thanks for your outstanding work. With a combination of your other lessons and this one I was able to create a Macro to automatize the download of several PDF files per time for the users on my job. Soon, I hope I can donate to your project.
@WiseOwlTutorials
@WiseOwlTutorials 5 жыл бұрын
You're welcome Andrés! Thank you for taking the time to leave a comment - it's always nice to know when the videos have helped people in their work!
@daves4026
@daves4026 4 жыл бұрын
I thank you for this awesomely deep tutorial. I always learn from your videos. Please keep the great work up, God bless you
@roshank9
@roshank9 6 жыл бұрын
Great. First time i have learned that even with VBA you can download the file. I tested too. Works great. Thank You:)
@khurramghori2231
@khurramghori2231 7 жыл бұрын
Hi, I ran the code at 18:29 and my MS Excel crashes, please advice. Thanks
@DM-py7pj
@DM-py7pj 4 жыл бұрын
Long time since I watched all these but if memory serves what is missing from this excellent series is coverage of queryselector/querySelectorAll, and the css selectors/pseudo-classes/combinators which can be used in VBA. Modern browsers are optimised for css, and, with some notable limitations, can be deployed with great flexibility across early-bound MSHTML.HTMLDocument when parsing HTML.
@andrefmartin
@andrefmartin 3 жыл бұрын
Fantastic video lesson! Very helpful. I have a question: How to download from web page a graphic, which is not a physical file but result on the screen got from another URL src ? I.e, how can we capture part of a screen in a web page, and download it locally as a image file via VBA ? I'm not finding answer to this challange so far
@WiseOwlTutorials
@WiseOwlTutorials 3 жыл бұрын
Hi Andre! I think that you might find it easier to do this using Google Chrome rather than Internet Explorer. We have some videos on using Google Chrome starting from part 57.1 in this playlist kzbin.info/aero/PLNIs-AWhQzcl3xKvF8sVL4sWRWICj_clM The SeleniumBasic library has a TakeScreenshot method - here's a very basic example of how it works: Private cd As Selenium.ChromeDriver Sub GetScreenShot() Set cd = New Selenium.ChromeDriver cd.Start cd.Get "www.wiseowl.co.uk" 'Screenshot entire browser window cd.TakeScreenshot.SaveAs "C:\Wise Owl\Image1.jpg" 'Screenshot specific element cd.FindElementByCss("#cycler").TakeScreenshot.SaveAs "C:\Wise Owl\Image2.jpg" End Sub I hope that helps!
@milindkhot768
@milindkhot768 2 жыл бұрын
The code in this project must be updated for use on 64-bit systems. Please review and update Declare statements and then mark them with the PtrSafe atribute. - This compile error is coming while declaring API of urldownloadtofile
@WiseOwlTutorials
@WiseOwlTutorials 2 жыл бұрын
Hi! You might find these two links useful docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/declare-statement docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/ptrsafe-keyword
@FajnyLarry
@FajnyLarry 3 жыл бұрын
How to make FUNCTION works on 64-bit systems?
@sudeepagrawal404
@sudeepagrawal404 7 жыл бұрын
Followed this video until 19:58 and I get an error message popup indicating : Run-time error: '453' Can't find DLL entry point URLDownloadToFileA in urlmon.dll.Can some one please help me.
@slicedbreadgames131
@slicedbreadgames131 5 жыл бұрын
I got the same error... Shot in the dark, but did you double-click on the title for this text on its page? If so, there's an extra space at the end of it. and if you placed this into your code, that one little extra space invalidates the Alias. Did you check your system32 folder to see if you have the dll?
@vladlemos
@vladlemos 7 жыл бұрын
Hi Andrew, thanks a lot for sharing! just amazing, congrats! the best explanation that I ever seen!
@hadireg
@hadireg 7 жыл бұрын
WOW the first time I know mid function returns the string to its very right end from the starting position!!! maan, I've been using VB since year 2000 :D
@maheshakaurigadde3971
@maheshakaurigadde3971 5 жыл бұрын
How do I download the bank statement using VBA macro???
@techsalesforce
@techsalesforce 4 жыл бұрын
Hi Andrew, When declaring the URLDownloadToFile function, I get an error saying that I should update my declaration to attend to 64 bit. Is there a 64 bit version of that line of code that I can use?
@jackalcock3907
@jackalcock3907 4 жыл бұрын
Option Explicit #If Win64 Then Public Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" () #End If This fixed the error for me.
@kashifkhanspecial
@kashifkhanspecial 8 жыл бұрын
Hi Andrew, Thank you so much for this lovely video tutorial, God bless you.
@bipinmakwana7246
@bipinmakwana7246 3 жыл бұрын
What if Site needs to put captcha everytime for each files ?
@yashsomaiya8141
@yashsomaiya8141 4 жыл бұрын
Hi I have one question why didn't you make even a single video MS Access macro?
@RupeshKumar-ms8bl
@RupeshKumar-ms8bl 4 жыл бұрын
Hey, Thanks for this tutorial. Can you please make a video to upload an image file to a server. Using POST multipart/form-data
@amrutchitragar3014
@amrutchitragar3014 4 жыл бұрын
Sir How to write VBA code to download a file sitting behind a JavaScript link? In ie automation
@BasBruijnis
@BasBruijnis 6 жыл бұрын
Hi Andrew, I get this error on function declaration, text also turns red --> *Private declare function URLDownloadTofile Lib "urlmon"* Compile error: The code in this project must be updated for use on 64-bit systems. Please review and update Declare statements and then mark them with the PtrSafe attribute. Any ideas how to fix this? Best regards, Bas
@slicedbreadgames131
@slicedbreadgames131 5 жыл бұрын
You have no name for your function. E.g. Private declare function URLDownloadTofile {function_name} Lib "urlmon"
@曾忠凱
@曾忠凱 2 жыл бұрын
Simply adding a "PtrSafe" worked for me: Public Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" ()
@playstorelaxman27mail20
@playstorelaxman27mail20 5 жыл бұрын
Instead of URL there is JavaScript_postback enable href can you help on this situation
@tomaszpietowski7010
@tomaszpietowski7010 4 жыл бұрын
very nice video and well done! It is very good explained! Thank you!
@chandrut3154
@chandrut3154 Жыл бұрын
Hiii, I am doing one exercise in VBA. I have completed it partially. Can you Do a video to access a SharePoint a links which is present in a single Excel and the Excel which contains the SharePoint links is also kept in one SharePoint link
@cedrois
@cedrois 2 жыл бұрын
thank you very much for that video the first 20min on how to Download a file was what I was looking for. However, your code is not taking in consideration when the browser ask to save or open the file once you click the download button. It will download the file only if there is no popup that happen. Otherwise, it do nothing ( the macro can be run but nothing is downloaded because it is prevented by the popup ) I searched everywhere on the Internet for an answer on how to VBA code this aspect but no clear answer. So my question is: How can we implement this function into your code? How can VBA automatically click on the save button when the popup happen on the browser side?
@WiseOwlTutorials
@WiseOwlTutorials 2 жыл бұрын
You're welcome John, I'm glad that some of the video was useful to you! I don't have an answer to clicking the save on a popup - it's not exposed to VBA via the IE library (you'll find the same is true for Chrome if you use Selenium). Sorry I can't help with that.
@ninjabomberboy8386
@ninjabomberboy8386 7 жыл бұрын
Hi Andrew, Loving your VBA lessons! I was wondering if you could tell me how to log into a website using this method and then start scraping? I have noticed that with the MSXML2.XMLHTTP60 .open function, there is an option to put in a username and password, is this the key to logging in? (it doesn't seem to work for me) Thank you!
@huonggiang537
@huonggiang537 2 жыл бұрын
Dear Andrew, In case the url is a request with Authorization header for login, is there a way to download the file? many thank
@SaulLeighton
@SaulLeighton 2 жыл бұрын
Thanks for your video WiseOwl. Have you had a chance to adapt the code to Windows 11 64-bit, running the latest 64-bit Office (Microsoft® Excel® for Microsoft 365 MSO (Version 2203 Build 16.0.15028.20152) 64-bit) ?? The download part no longer seems to work.
@WiseOwlTutorials
@WiseOwlTutorials 2 жыл бұрын
Hi Saul! Sorry no I haven't had time to play with Windows 11 yet I'm afraid.
@gangendiranmaths6075
@gangendiranmaths6075 4 жыл бұрын
Hi , Am very new to the VBA macro and am into my first project. I have used ms internet control and ms HTML object references to automate the internet explore. Am done with all the required criteria like navigate to URL and click and choose the required things. All I need to do is , How to make a code to wait until the download complete since the download size different I can't use the wait option. Once download completed I need to save it and loop through the another things. Any suggestions and help. Thanks in advance.
@jaywilliams3423
@jaywilliams3423 7 жыл бұрын
Hi I was wondering is there a way to use a similar method to upload a file to a website?Thanks
@elricho72
@elricho72 2 жыл бұрын
Great Video ! 😀
@WiseOwlTutorials
@WiseOwlTutorials 2 жыл бұрын
Thanks Richo!
@kennyenoshmanova5426
@kennyenoshmanova5426 4 жыл бұрын
first of all thank you for this video, can we get the excel file what you worked on.
@WiseOwlTutorials
@WiseOwlTutorials 4 жыл бұрын
You certainly can! You'll find a link in the description below the video to the page on the Wise Owl website where you can download the file. I hope that helps and thanks for watching!
@zankrizanovski1282
@zankrizanovski1282 8 жыл бұрын
Is there any way that you can also pass 2 parameters to log in, and then download the file as shown in the video?
@rishabhjain3708
@rishabhjain3708 4 жыл бұрын
Hello Sir, Could you please help with some code to click an angular button on a website using VBA? Regards, Rishabh Jain
@alexandrazettervall8641
@alexandrazettervall8641 2 жыл бұрын
Very helpful video, but my excel crashes and restarts when I try to run the part 18 min into the video (testing downloading the file the first time). I suspect that it's due to excel being run in Citrix and I probably don't use a correct DestinationFile url... Any pointers to solve it when I don't seem to be able to save to urls such as C:\Temp ?
@WiseOwlTutorials
@WiseOwlTutorials 2 жыл бұрын
Hi Alexandra! Sorry I'm not familiar with working in Citrix. My first port of call for help with this type of issue is Stackoverflow stackoverflow.com/search?q=vba+citrix&s=fc1338ef-72d5-4149-80b8-df24f3ab0809 I hope it helps!
@dunnobe
@dunnobe 5 жыл бұрын
Thank you for your tutorial. It helped me exacly with what I wanted to achieve.
@WiseOwlTutorials
@WiseOwlTutorials 5 жыл бұрын
You're welcome, happy to hear that it helped and thanks for watching!
@dunnobe
@dunnobe 5 жыл бұрын
@@WiseOwlTutorials Do you happen to have a tutorial on API? I would want to connect to the website/database of the IMF and download data there.
@dunnobe
@dunnobe 5 жыл бұрын
@@WiseOwlTutorials datahelp.imf.org/knowledgebase/articles/630877-data-services
@wagnerjunior2789
@wagnerjunior2789 4 жыл бұрын
Hi guys, It appears a saving message box from explorer, how do i continue? i've tried using sendkeys, apis..but nothing....anyone ?
@何维涛
@何维涛 2 жыл бұрын
good to see this video ,it's very usefull for me !
@WiseOwlTutorials
@WiseOwlTutorials 2 жыл бұрын
Happy to hear that, thank you for watching!
@mustafabakkal8551
@mustafabakkal8551 8 жыл бұрын
can we get the directlu codes
@nicolasrogeliosierraroca8195
@nicolasrogeliosierraroca8195 7 жыл бұрын
I like to learn how download a file from a taxes web page, I´m from mexico and I´d like learn how to do a code... another words... I want scrap a web page contains a xml files and save its on my computer... is possible?
@selfsage1
@selfsage1 7 жыл бұрын
Hii how to download .csv file to excel in the same sheet than copying in a destination folder! thanks
@slicedbreadgames131
@slicedbreadgames131 5 жыл бұрын
I would try the "QueryTables.Add" method. It has a lot of ways to delimit (i.e. common one, ."TextFileCommaDelimiter = True"). This way, as long as you have access, it limits the coding you have to do, and less exhaustive on your resources.
@KuldeepSingh-nq1vi
@KuldeepSingh-nq1vi 3 жыл бұрын
Hi Andrew, how to capture file name of downloaded excel file or how to open downloaded excel file, please make a video on same.
@WiseOwlTutorials
@WiseOwlTutorials 3 жыл бұрын
Hi Kuldeep! If you're using the URLDownloadToFile method then you get to choose the file name and location!
@robertobermaier2594
@robertobermaier2594 3 жыл бұрын
I just tried to use your vba code to download a file from an internal company connext page. It unfortunately downloads only 4kB of the 1MB file. A simple click on the link which I placed in a worksheet opens a download dialog of the Internet explorer and if I manually click on the save button it downloads completely. Any idea what I can do to get it automated?
@WiseOwlTutorials
@WiseOwlTutorials 3 жыл бұрын
Hi Robert! I'm not sure on this one, there's a suggested answer here which seems plausible stackoverflow.com/questions/39952086/vba-code-to-wait-until-file-download-from-ie-is-complete I haven't tried it but it might help!
@itsmemohit
@itsmemohit 5 жыл бұрын
Hi, the downloaded file is showing only 4kb, regardless of which file i choose to download from a given sharepoint page?
@anjarsaputra7909
@anjarsaputra7909 3 жыл бұрын
is there any tutorial how to upload file automate in IE?
@WiseOwlTutorials
@WiseOwlTutorials 3 жыл бұрын
Hi Anjar, sorry but we don't have a tutorial on that topic at the moment.
@savaishra
@savaishra 7 жыл бұрын
Hi Andrew, Thanks for the tutorial. Does the same method you have posted above, is suitable for download files from a PLM? If not, can you provide instructions for download all files from a PLM? I have to download 2000 files having respective unique identification number from PLM. Thanks in advance
@axelamoe
@axelamoe 2 жыл бұрын
I am downloading a pdf file from a secure website after logging in and getting the link, however the downloaded file always seems to be corrupt and nothing shows or opens! Any ideas?
@WiseOwlTutorials
@WiseOwlTutorials 2 жыл бұрын
I'm sorry I don't know the answer to that one!
@krn14242
@krn14242 8 жыл бұрын
Thanks Andrew, Excellent video. Cheers!
@yasserahmed7440
@yasserahmed7440 2 жыл бұрын
Thanks for your great video. Your code works well with normal links but when the image url starts with "blob",it give me error. How can I download these images? please help me.
@WiseOwlTutorials
@WiseOwlTutorials 2 жыл бұрын
Sorry Yasser, I don't know. Did you find a solution?
@yasserahmed7440
@yasserahmed7440 2 жыл бұрын
@@WiseOwlTutorials Not yet
@nhatminh1485
@nhatminh1485 3 жыл бұрын
Hi add. Can you show me how to upload files to the web?
@WiseOwlTutorials
@WiseOwlTutorials 3 жыл бұрын
Hi there! I have this topic on my To Do list but I'm not sure when I will be adding this video.
@abbegaetan7328
@abbegaetan7328 4 жыл бұрын
Hi Andrew, Thank you for this video tutorial. I would like to automatically download excel files from SharePoint subfolders. The folders and subfolders do not exist already. People can create folder and upload excel file (A checklist). Can you help me please?
@travllingisfun6189
@travllingisfun6189 4 жыл бұрын
Can we download pdf from web using VBA script..
@DM-py7pj
@DM-py7pj 4 жыл бұрын
yes
@srutikulanthaivel1048
@srutikulanthaivel1048 3 жыл бұрын
Hi @WiseOwlTutorials, I have a problem when I run this exact code. "Acrobat could not open '[name of file]' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)" I need to download PDFs and I also need the code to pick these URLs from a code. Can you please help me here? First I want to solve this error.
@srutikulanthaivel1048
@srutikulanthaivel1048 3 жыл бұрын
I also need the code to pick these URLs from a range of cells on the Excel file**
@WiseOwlTutorials
@WiseOwlTutorials 3 жыл бұрын
Hi Sruti, sorry but I don't know the answer to that one.
@chobblegobbler6671
@chobblegobbler6671 5 жыл бұрын
Hi Andrew, Must Javascript be turned on in IE for this exercise?
@mohamedelgendy4603
@mohamedelgendy4603 4 жыл бұрын
I need a help in this vba code please I have 2 sheets and there is column w in sheet1 has a hyperlink value linked to sheet 2 and I need when I click in any value of these hyperlinks in this coulmn (move me in sheet2 and make filter with the value I clicked in sheet1) my problem My code make filter with static value sheet1a1 while I need the value of active cell in sheet1 Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) Sheet2.Range(Sheet2.Range("A1"), Sheet2.Range("A" & Rows.Count).End(xlUp)).AutoFilter Field:=1, Criteria1:=Target.Name End Sub
@UpYours101
@UpYours101 7 жыл бұрын
jw, did you ever do a video on vba api's? or scrapping/emulating a desktop application or screen? just looking for new projects to learn. thank you
@UpYours101
@UpYours101 7 жыл бұрын
WiseOwlTutorials i understand completely, thanks for the follow-up and the vids
@johntelly1789
@johntelly1789 5 жыл бұрын
Hi Andrew, Thank you for the videos and the great explanations. I downloaded the files for this video and when I unzipped them, my anti-virus software detected a Trojan. Would you know why this could be? Also, has anyone else encountered a similar problem? Thanks
@sim7717
@sim7717 8 жыл бұрын
Another unique one. Awesomely nice.
@IronMoe
@IronMoe 7 жыл бұрын
Hi, im a newbie in VBA and still learning as of now, may i request for your kind assistance. I want to automate to a PDF file from a website with user name and password. And will save the PDF file to my desktop folder. Is that possible?
@IronMoe
@IronMoe 7 жыл бұрын
Thank you for you effort to answer my question. :-)
@bilalshah0505
@bilalshah0505 6 жыл бұрын
Hi Sir.. i need your help in creating a program that uploads a file to webpage. The input type file element in browser does not support directly setting up the file path. I have a workaround using vbs script and send keys but does not really look good to me. You help is appreciated if u would loke to show how to set the valie of input type file in a browser with file name in the best possible way. Regards Bilal shah
@KhalilYasser
@KhalilYasser 5 жыл бұрын
Thank you very much my tutor for this incredible tutorial. Why in module `m_ProcessVideoPages` you declared the variable `htmlCell` as IHTMLElement3 and not as IHTMLElement3. Is there a difference or this is just the same ?
@WiseOwlTutorials
@WiseOwlTutorials 5 жыл бұрын
Hi Yasser, you can read a little about this here stackoverflow.com/questions/13016084/in-mshtml-what-do-the-numbers-mean-like-in-ihtmlelement7 and here stackoverflow.com/questions/9619502/what-happens-when-using-ihtmlelement5-6-for-ie8-9-in-ie6-7-does-it-divert-to I hope that helps!
@axelamoe
@axelamoe 2 жыл бұрын
I am getting an error 453 can’t find dll entry point for UrlDownloadfilea urlmon any help?
@WiseOwlTutorials
@WiseOwlTutorials 2 жыл бұрын
I'm not sure if this is just a typo in your comment but it should be urldownloadtofilea rather than urldownloadfilea
@axelamoe
@axelamoe 2 жыл бұрын
@@WiseOwlTutorials Yea you are right I wrote it out wrong. I got it fixed but still getting the corrupted file I feel like because it is a secure website, it is blocking selenium. Thank you
@josephsstudio9134
@josephsstudio9134 3 жыл бұрын
Any idea on how to avoid MBAM Generic Exploit error when saving?
@WiseOwlTutorials
@WiseOwlTutorials 3 жыл бұрын
Hi, I'm not sure, is that a Malware Bytes message? If so I would try altering the settings as described in this thread forums.malwarebytes.com/topic/265085-microsoft-office-word-saying-malwareexploitgeneric/ I hope that helps!
@josephsstudio9134
@josephsstudio9134 3 жыл бұрын
@@WiseOwlTutorials It was an MBAM message. I ended up changing my antivirus to another one, then found a way to download (with login credentials) without using an API. It's a little dirty, per se, but it gets the job done. I learned that the URLDownloadToFile is only a GET method so I couldn't login using it. Even with other login procedures. So thank you. Basically I open IE11, login (elementID), iterate through my sheet the URLs to open and save the file using SendKeys. Like I said, a little dirty, but right now, it works.
@WiseOwlTutorials
@WiseOwlTutorials 3 жыл бұрын
@@josephsstudio9134 Cool! If it works then I guess that's the most important thing. Thanks for taking the time to let us know how you solved your problem, hopefully it will help others too!
@josephsstudio9134
@josephsstudio9134 3 жыл бұрын
@@WiseOwlTutorials I hope so. It's still a little broken at times if I run it over 200 entries (array needed ReDim). Hopefully I can move it to away from IE11 since IE11 won't be supported later this year.
@WiseOwlTutorials
@WiseOwlTutorials 3 жыл бұрын
@@josephsstudio9134 Just in case it helps, I made some videos on how to use Google Chrome with Excel VBA recently. I don't have a specific video on downloading files yet but you might find this playlist helpful (the Chrome videos start at part 57.1) kzbin.info/aero/PLNIs-AWhQzcl3xKvF8sVL4sWRWICj_clM
@emrezkc
@emrezkc 2 жыл бұрын
such valuable info
@WiseOwlTutorials
@WiseOwlTutorials 2 жыл бұрын
Thanks!
@wajidazeemfy
@wajidazeemfy 7 жыл бұрын
Hi Andrew If I run the routine (at 18:35 in video) I get "Run-time error '453': Can't find DLL entry point URLDownloadedtoFileA in urlmon". and the line that calls the function gets highlighted in yellow. Please advise solution...
@sudeepagrawal404
@sudeepagrawal404 7 жыл бұрын
I get the same error, even without the typing mistake.
@axelamoe
@axelamoe 2 жыл бұрын
Did you get this figured out I am getting the same error?
@wajidazeemfy
@wajidazeemfy 2 жыл бұрын
No.. no solution with me...
@nsrchndshkh
@nsrchndshkh 7 жыл бұрын
Hi Wise Owl, Thanks for all the videos. Would you upload video on "How to upload files on website e.g (Yammer) using VBA?"
@slicedbreadgames131
@slicedbreadgames131 5 жыл бұрын
I would love to ask him this! Maybe you can put the DestinationURL as the actual website directory it'll be stored in. I know with Office products, another was to open a, say Word doc, if you have access, you can just plug the whole URL into the open dialog box (blahblah/thispage/wordfile.docx), then it'll be unsaved in your Temp IE files (most likely), and it's read-only until you save it...
@iamsopure1043
@iamsopure1043 7 жыл бұрын
Hi Andrew. My situation is that I need to select several values (such as client name and reporting period) from a couple of drop down lists in a web page and then download. I am wondering if you have idea how I can possibly pass an option value into the drop down list? The HTML code is some thing like below: Client_Name_1 Client_Name_2 Client_Name_3 Thank you so much!
@iamsopure1043
@iamsopure1043 7 жыл бұрын
***** Thank you Andrew.
@merchant2730
@merchant2730 7 жыл бұрын
Hi, I am trying to download a csv file but once it downloads, the content within the file turns into HTML jibbrish. Any suggestion to get the file downloaded as it is intended to be would be much appreciated.
@merchant2730
@merchant2730 7 жыл бұрын
I see the file as it should be. Here I am posting the link: bulk.ginniemae.gov/protectedfiledownload.aspx?dlfile=data_bulk/mfppprpt.csv
@donbogdala5428
@donbogdala5428 8 жыл бұрын
Great Tutorial Andrew!
@hoangmanhthang2873
@hoangmanhthang2873 7 жыл бұрын
Hi Andrew, Thanks for the tutorial. I saw at the end of the video is that we choose download to this folder manually. Is there any codes to automatically choose the "download to this folder" dialog box? or "cancel" thank you so much
@hoangmanhthang2873
@hoangmanhthang2873 7 жыл бұрын
+WiseOwlTutorials Hi, because of login method so I use internet explorer to download file and it show up save or open button. I just curious how to automatically click this. thanks
@hoangmanhthang2873
@hoangmanhthang2873 7 жыл бұрын
Ya! love so much your reply! I read on that topic but somehow I don't understand the deep root of it. It would be great if you could make a tutorial for this if you have spare times. It could save me a lot of times and get more deeper knowledge into how VBA works.
@hoangmanhthang2873
@hoangmanhthang2873 7 жыл бұрын
That would be great!!! SendKeys method seems to works while the IE is current window and visible right? For downloading a file, I think it should be IE.visible = False to get our automation target to download the file . And in my case, I put the sendkey below the downloading link, then run the code but nothing happen, may be I still stuck on something I don't know. Anyway thank you.
@mikkokoskinen3372
@mikkokoskinen3372 6 жыл бұрын
Hi Andrew, @21min 30 sec, I am able to run the code and I get the "File download started" message. However, the file does not appear in the destination folder. I'm not sure how to troubleshoot the issue or figure out why this the file does not appear.
@slicedbreadgames131
@slicedbreadgames131 5 жыл бұрын
If your destination is your expectation, perhaps the file to be downloaded restricts downloading from the Host. If Destination and Source are correct, w/proper extensions, I would say perhaps a Host issue...
@mohanreddyk1983
@mohanreddyk1983 7 жыл бұрын
“Automation Error: Object Invoked has disconnected from its clients” I am trying to automate the Internet Explorer to scrape the data. But I am getting continuously the below error. So please share your thoughts / inputs to resolve this error. “Automation Error: Object Invoked has disconnected from its clients” Thanks a lot in advance!
@slicedbreadgames131
@slicedbreadgames131 5 жыл бұрын
I've always gotten this when the difference of using InternetExplorer or InterExplorerMedium ("medium integrity" per MSDN site). I have to use that one al the time while coding at work. But at home, no intranet to deal with. Try - 1. DIm IE as InterExplorerMedium 2. must always use 'navigate' method before setting 'visible' property 3. try to use late binding (dim IE, then Set IE separately, then after creating instance of IE, perhaps do Application.Wait for a few seconds) 4. frequently, throw in this to do 'nothing' while IE object is loading/busy Do Loop until IE.busy = False
@jjohnsonwichita
@jjohnsonwichita 4 жыл бұрын
Hi Andrew, I developed my own file download based on your code and it works great, except that it only finds 3 of the 8 hyperlink tags. I don't understand this. This is the web page FileURL = "kcnr.net/aboutus.php?p=new_bulletins". Any help would be appreciated.
@DM-py7pj
@DM-py7pj 4 жыл бұрын
Which hyperlinks are you after? What is an example missing link you expected to retrieve?
@vsiebert10
@vsiebert10 4 жыл бұрын
Hi Andrew - I am receiving an error when i try to run "compile error: User defined type not defined"... I have the urlmon on the computer but not sure how I am supposed to activate it ? or get rid of this error? I appreciate your help.
@DM-py7pj
@DM-py7pj 4 жыл бұрын
which line does error occur on?
@walthergroenewald9368
@walthergroenewald9368 4 жыл бұрын
How about when a website has an element: ..... essentially that gives me a webpage that can be printed or saved as PDF. How can I automatically download this as PDF?
@DM-py7pj
@DM-py7pj 4 жыл бұрын
ie.document.querySelector(".fa-file-pdf-o").click though IE is not ideal for this as prompts for saveas/open which is a nuisance. Selenium is better as can specify default download folder.
@jrerickson119
@jrerickson119 8 жыл бұрын
Would this also work with PDF documents that are linked in the webpage. I am looking to use this same concept with PDF's however, I am receiving the following error when trying to open the pdf: "Acrobat could not open 'test1.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded). fyi: I am about 47 mins into this video after downloading said files and attempting to open them. Any help would be greatly appreciated! Excellent video by the way, thank you!
@jrerickson119
@jrerickson119 8 жыл бұрын
I have actually figured out the solution to my problem. Please, disregard my last comment! Thank you for this excellent tutorial!
@lsuk7523
@lsuk7523 2 жыл бұрын
Hi Sir, is this only works with internet explorer cause my company has disabled or removed the IE from there system...this API is not working.. Pls is there any other way to download file from chrome or edge as don't wanna use seleniam for this?
@WiseOwlTutorials
@WiseOwlTutorials 2 жыл бұрын
Yes, the URLDownloadToFile function relies on Internet Explorer. Try this as an alternative stackoverflow.com/questions/17877389/how-do-i-download-a-file-using-vba-without-internet-explorer
@lsuk7523
@lsuk7523 2 жыл бұрын
@@WiseOwlTutorials thanku for the reply...i understood my work wrong. I need to dowload the file from SharePoint and that file is downloading but it's corrupted always. With URLtodownload method or http req?..pls give me any suggestion?
@miguelbandieramonte
@miguelbandieramonte 4 жыл бұрын
Hi Andrew, really great stuff!! I was able to make it works, but (there is always a "but" :-) ) I tried to use it in my job, and the report I need to download is behind a password protected webpage. Even if I give the URL the file download has the http code asking for a user and password. I tried then using the webbrowser control, that's give the user the chance to login and then hide userform to continue with the macros. It worked perfectly so I assume this function use the webbrowser open connection. Then, (here is the "but") I tried to use the IE object instead, BUT this function ignore the session the IE object opened and brought me again the file asking user and pass. Any clever way to use the IE session? Thanks in advance!!!
@hristonikodinovski1522
@hristonikodinovski1522 7 жыл бұрын
Can you pass in UserName and Password with this method?
@slicedbreadgames131
@slicedbreadgames131 5 жыл бұрын
If you're saying you have to login before you can download... you can perhaps login via XML or WinHttp, then attempt to run the Lib function. I'm unsure how access issues react to this download function. Maybe if you logon the one time, then however long the session is, and providing you don't have to pass around cookies, then might work...
@ricardogoncalves9453
@ricardogoncalves9453 7 жыл бұрын
Hi!! I followed all the steps until the minute 20:53. But when running it goes directly to the "File download not started", what could be, if I have seen the code several times and it is the same? Thank you
@slicedbreadgames131
@slicedbreadgames131 5 жыл бұрын
After sometime does it eventually finish? Perhaps a slow Host that takes longer to queue, and the VBA runs so quick it might pass that conditional IF statement before you get a good return from the server. Does the Source file change (does clicking it on a browser show that it generates a token of sorts to the end of the file name, thus having an invalid SourceURL every time?) I would try to use the "OnCodeInstallProblem" function to get the status of the download... Hope this helps.
@natiaparekhelashvili913
@natiaparekhelashvili913 3 жыл бұрын
Hello Andrew, thanks for this video. I have a list of google drive files in my excel sheet. How can i download these files into my local folder? Can i use the same methode you taught? What if it asks for username password? Thanks 😘❤
@WiseOwlTutorials
@WiseOwlTutorials 3 жыл бұрын
Hello! Apparently the URLDownloadToFile technique works with files on Google Drive, at least if permission is granted to anyone with the link. If you need a username and password you might try the options shown in this thread stackoverflow.com/questions/17877389/how-do-i-download-a-file-using-vba-without-internet-explorer I hope it helps!
@sheikabdullah179
@sheikabdullah179 5 жыл бұрын
Hi Andrew, I have part numbers list in excel I need to search and download the model,drawing and pdf for the respective part numbers from web portal. Can you please help me on this
@WiseOwlTutorials
@WiseOwlTutorials 5 жыл бұрын
Hi there, I can try to help if you have a specific question. What have you done so far? Is there a specific part of your code that isn't working?
@sheikabdullah179
@sheikabdullah179 5 жыл бұрын
WiseOwlTutorials I can’t able to write please help me on this
@WiseOwlTutorials
@WiseOwlTutorials 5 жыл бұрын
Hi, I can try to help you with specific questions. If you have any please post them on the relevant video on KZbin or on our website.
@starlord5554
@starlord5554 3 жыл бұрын
Wow , amazing video ( I have problem downloading web pages with scripts )
@ambrishraval5514
@ambrishraval5514 6 жыл бұрын
Hi, im a newbie in VBA and still learning as of now, may i request for your kind assistance. I want to automate web page filling , thru vba code I am abel to login in web site but not abel to click further - on Inspect element it shows as "" it not showing any name of button, pls help me.Thanks.
@slicedbreadgames131
@slicedbreadgames131 5 жыл бұрын
HTML can assign a link attribute to any type of tag. Luckily for this one, the element has an ID, which has to be unique, per Doc. So you can do - HTMLDoc.getElementByid("navBar0_menu1_dmmy1").click.
@chanu312
@chanu312 7 жыл бұрын
I want to download a Excel file from website, I can able select the month on the Web page and then after clicking download i am getting Pop - up with options like save, save as and Open, how can I select the options save, save as or open
@Myrslokstok
@Myrslokstok 6 жыл бұрын
Chanakya S I think you can not controll that from excel in a good way.
@slicedbreadgames131
@slicedbreadgames131 5 жыл бұрын
If you're using HTML object library and using the .click method, you may see that Ctrl+J window (in IE). When you use the LIB function, there's no object, neither HTML nor IE, in which that popup could appear. In Andrew's video, you use the HTML object to get the elements needed, to get the download URL, then pass that into the download function with uses the LIB.
@Sameerkhan-cs8ln
@Sameerkhan-cs8ln 7 жыл бұрын
Hi Andrew, I've came across a scenario where instead of url there was javascript_postback enabled href. Is there is a way to automate file download from js enabled href.
@Sameerkhan-cs8ln
@Sameerkhan-cs8ln 7 жыл бұрын
Thank you Andrew, link worked well for me. Any chance of new tutorial on XMLHTTP request with regex to extract inner text.
@saimanohar194
@saimanohar194 5 жыл бұрын
Hello Andrew and Sameer, could you please help me as well with the solution to this situation?
@guidoosterwald7343
@guidoosterwald7343 4 жыл бұрын
Brilliant Job! Thank you!
@edwinmiranda4005
@edwinmiranda4005 5 жыл бұрын
Very helpful video! I was able to create my own code to download .txt files from a site, but I also want to download the PDF version of these files. The PDF file opens up in a new window when I click a button on the site. I try to find the download link when inspecting the element on the button but I can't seem to find it and get this to work, or maybe I'm doing something wrong. Do you have an idea of how to accomplish this? any help will be greatly appreciated!
@WiseOwlTutorials
@WiseOwlTutorials 5 жыл бұрын
Hi there, strange that you can't see the path of the pdf file that you're viewing, does it not show in the address bar of the new window that appears? If you can't find the URL of the pdf file to download perhaps you could just save the txt files you have downloaded as pdf files using Word for example? The basic code would look like this: Sub SaveTextAsPDFEarlyBinding() 'From the menu choose Tools | References... 'Select the Microsoft Word ##.# Object Library Dim wd As Word.Application Dim doc As Word.Document Set wd = New Word.Application wd.Visible = True Set doc = wd.Documents.Open(Filename:="C:\Wise Owl\My Text File.txt", Format:=wdOpenFormatUnicodeText) doc.SaveAs2 Filename:="C:\Wise Owl\My Text File", FileFormat:=wdFormatPDF doc.Close wd.Quit End Sub You could also do this using late-binding if you don't want to set a reference the Word library: Sub SaveTextAsPDFLateBinding() 'No reference to the Word library needed Dim wd As Object Dim doc As Object Set wd = CreateObject(Class:="Word.Application") wd.Visible = True Set doc = wd.Documents.Open(Filename:="C:\Wise Owl\My Text File.txt", Format:=5) doc.SaveAs2 Filename:="C:\Wise Owl\My Text File", FileFormat:=17 doc.Close wd.Quit End Sub I hope that gives you some idea of a way forward. By the way, your Mustang looks and sounds amazing! :D
@edwinmiranda4005
@edwinmiranda4005 5 жыл бұрын
WiseOwlTutorials thanks for the reply, I’ll give this a try! And thanks for the compliments, I love Mustangs 😎
@WiseOwlTutorials
@WiseOwlTutorials 5 жыл бұрын
So do I! But not all that common here in the UK. I had a 1980 Fox body with a 3.0l V6 from a Ford Granada for a short while. About 13 years ago I bought a wreck of a '71 Mach 1 351 with ambitions of restoring it. Lack of funds and time means it's still a wreck to this day! A guy down the road from me has a beautiful 2019 Bullitt (or at least it's got the Dark Highland Green paint job) which I drool over every time I walk past it! Let me know how you get on with the pdf files.
@edwinmiranda4005
@edwinmiranda4005 5 жыл бұрын
WiseOwlTutorials oh wow! my dream car is the Mach 1! And yes I’ll keep you updated on the pdf download!
@edwinmiranda4005
@edwinmiranda4005 5 жыл бұрын
WiseOwlTutorials after inspecting the element I see that there is no pdf link because the button has an “onclick” element and it pop ups the pdf in a new window. Copying the link address from the button gives me “void(null);” The href on the button shows me I tried using the link on the address bar from the new window after it pops up the pdf but that didn’t work.
@loveroflife2157
@loveroflife2157 7 жыл бұрын
Thx for the tutorial. Very impressive.
@forzaalgiers2045
@forzaalgiers2045 8 жыл бұрын
Thank you for the tutorial, the video and the file
@TonyDiaz.
@TonyDiaz. 8 жыл бұрын
Awesome super awesome!!!! As always...
@hussainofficialyoutube
@hussainofficialyoutube 5 жыл бұрын
Thank you very much for wonderful video. :) Could you please help me out to how to get the download link when we don't have file extension like .zip, .pdf,.jpg on download links in which we copy the download link short cut, cause some of the websites will generate using some php or javascript by click on download button and will generate random file name with it's extension. So that we can apply this URLDowloadtoFile procedure. Once again you are the best which i prefer first in youtube. Thank you :)
@milindkhot768
@milindkhot768 2 жыл бұрын
Please suggest
@hadireg
@hadireg 7 жыл бұрын
Awesome wiseowl!!
@ivanonanga2195
@ivanonanga2195 6 жыл бұрын
Hey @WiseOwlTutorials what's wrong??? it's been a while since the last video??? It's sad! We feel abondonned!
@franciscopessoa4925
@franciscopessoa4925 2 жыл бұрын
u r a beast
@WiseOwlTutorials
@WiseOwlTutorials 2 жыл бұрын
😀 Thanks!
Excel VBA Introduction Part 50.1 - Introduction to Charts in VBA
1:01:43
WiseOwlTutorials
Рет қаралды 54 М.
Excel VBA: Using Class Modules with Collections (5/5)
13:37
Excel Macro Mastery
Рет қаралды 72 М.
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 27 МЛН
[BEFORE vs AFTER] Incredibox Sprunki - Freaky Song
00:15
Horror Skunx 2
Рет қаралды 20 МЛН
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 49 МЛН
How to use Custom Types To Write Ultra Fast VBA code
12:51
Excel Macro Mastery
Рет қаралды 33 М.
Import Web Data to Excel using VBA Macros
20:29
TeachExcel
Рет қаралды 178 М.
Copying Data from User Selected Files Using GetOpenFilename
10:26
Excel Macro Mastery
Рет қаралды 21 М.
VBA to download Files from Internet - Super Fast API
8:01
VBA A2Z
Рет қаралды 49 М.
How to Combine Multiple Excel Files using VBA
19:06
Excel Macro Mastery
Рет қаралды 35 М.
Excel VBA Introduction Part 22 - Files and Folders (FileSystemObjects)
48:33
How to Automate Edge Browser using Excel Macros
20:03
Automation Made Easy
Рет қаралды 93 М.
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 27 МЛН