+ Reply to Thread
Results 1 to 10 of 10

Download file from intranet

  1. #1
    Registered User
    Join Date
    09-20-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2013
    Posts
    84

    Download file from intranet

    Dear all,

    I knew nothing about VBA but I managed and felt relieved to have prepared the below codes to download the loads of files in intranet weekly at work through reading online resources. I understood that SENDKEYS is an unreliable method. However, I found other methods incomprehensible. I still would like to know if there are other improvement I can make to the below code to at least download a finite number of files I need. As it is now downloading files at random, sometimes I got all the files I need, with most of the time missing 3 to 4 files at random. Thank you!

    *****************************************************************************



    Please Login or Register  to view this content.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Download file from intranet

    How do you determine what files you want to download, and their locations? Please don't make us reverse engineer your existing code. Provide a response that explains it from scratch, rather than describing what your code does. It looks like you are somehow using a web page to do this, so describe the web page. It might be possible to do this by directly sending GET commands over HTTP rather than using keystrokes to manipulate Internet Explorer, but we'll have to see your explanation.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    09-20-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2013
    Posts
    84

    Re: Download file from intranet

    Dear all,

    Sorry that I have not made my query clear.

    After loggin, I have to click a link (with innertext=ABC) in the menu page which would direct me to another page. There I have to click the option list to locate the table name. That's the part about "op in dropOptions list" and onchange. The interface would then list out a form for which I have to input one code from a column of an excel list for each download. I have to press "Print" button after inputting one code in the field. The webbrowser would then prompt a save button. I would then need to input another code and press "Print" again until all the files have been downloaded. The files would be downloaded to the folder "Download" directly using the sendkeys method as listed above.

    Thank you for looking into this.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Download file from intranet

    Isn't it possible to derive the target URL and go there directly without having to click through two pages to get there?

    If you have to click on browser controls to get to the page you want then I don't think you have a better option, but I am not an expert at managing web pages from VBA.

  5. #5
    Registered User
    Join Date
    09-20-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2013
    Posts
    84

    Re: Download file from intranet

    Dear all,

    Could anyone advise if
    Please Login or Register  to view this content.
    would affect the file downloading procedure making it missing some files in some iterations?
    Or
    Please Login or Register  to view this content.
    this line would be the cause? I have tried 5 sec, still missing some files. What should be the appropriate timing? Thanks!
    Last edited by 6StringJazzer; 06-08-2022 at 11:09 AM. Reason: fixed code tags. Ending tag must be [/CODE]

  6. #6
    Forum Contributor
    Join Date
    02-25-2022
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365
    Posts
    174

    Re: Download file from intranet

    Microsoft Internet Controls are based on IE. IE is being discontinued and most websites don't work with it. I stopped using it about 5 years ago. To work with the web use Selenium. There is VBA COM addin called Selenium Basic. I use to use a command line tool called mget to download files. I didn't have to authenticate to access file.

  7. #7
    Registered User
    Join Date
    09-20-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2013
    Posts
    84

    Re: Download file from intranet

    Dear Mogul,
    I am so grateful to your reply. I downloaded Selenium yesterday and found that I cannot have dot framework 3.5 installed since I got no admin rights. I do need loggin and type some codes to access the files. Anyway, I can see selenium is the only way now. Thank you so much for your guidance and I do hope there is leeway after 15 Jun. In fact i just figured out this automation method half year ago and was too ignorant to learn that it would fade out soon.

  8. #8
    Registered User
    Join Date
    09-20-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2013
    Posts
    84

    Re: Download file from intranet

    Dear all, I managed to download the excel files using Python with Selenium. Would there be security issue if I store the confidential data in excel and they were input to Chrome automatically using send keys?

    Thanks!

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Download file from intranet

    What kind of security issue are you thinking about? Storing the data? Or sending it to Chrome? What security controls does your organization require? So far in this thread you have only talked about downloading files. You have not mentioned "input to Chrome" except for your last post. What do you mean by that?

  10. #10
    Registered User
    Join Date
    09-20-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2013
    Posts
    84

    Re: Download file from intranet

    Sorry that I have not made myself clear. Yes, so would there be data leak when inputting the data into chrome before it generates excel files to download? I think password would have to be set for the excel storing the data. Would there be any security risk in downloading python and selenium?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 07-29-2021, 08:23 AM
  2. delete/kill a file on sharepoint intranet
    By cwchan220 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-21-2014, 01:12 PM
  3. Save a file to an intranet accessed folder
    By BillMax in forum Excel General
    Replies: 0
    Last Post: 05-11-2011, 03:41 PM
  4. Download data from intranet page
    By mojo249 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2011, 05:50 PM
  5. Open excel file on Intranet
    By PRodgers4284 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-28-2010, 06:32 AM
  6. Intranet Excel File...Changing Name
    By Sharky23 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-23-2006, 10:20 PM
  7. Open excel file from password protected Intranet site(IE)
    By Dan McCollick in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-17-2006, 02:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1