+ Reply to Thread
Results 1 to 6 of 6

Macro to download a file by click a button on internet link

  1. #1
    Registered User
    Join Date
    10-09-2014
    Location
    Cork,Ireland
    MS-Off Ver
    2010
    Posts
    3

    Macro to download a file by click a button on internet link

    Hi there,


    I want a macro that goes to a website and clicks a button and downloads an excel file and then I want to copy it into my current file to manipulate.


    Please Login or Register  to view this content.
    This works wonderfully except it downloads the url which I know is correct in the code but I need to go an extra step as on the URL you need to click 'export to excel' button to download the file.


    The relevant HTML code is (I think!!):


    PHP Code: 
    <td style=" text-align: center; font-size: 12px;">
    <
    input type="submit" name="ctl00$ContentPlaceHolder1$btnExportToExcelvalue="Export To Excel" id="ctl00_ContentPlaceHolder1_btnExportToExcel" class="Loginbtn" style="width:191px;" /></td

    thanks in advance of any help.


    Noreen (New User )
    Last edited by alansidman; 10-09-2014 at 10:35 AM. Reason: Code tags added

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,864

    Re: Macro to download a file by click a button on internet link

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    10-09-2014
    Location
    Cork,Ireland
    MS-Off Ver
    2010
    Posts
    3

    Re: Macro to download a file by click a button on internet link

    Ok Thanks, any help?!

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,864

    Re: Macro to download a file by click a button on internet link

    This one is out of my wheel house. Hopefully someone with expertise in this area will help.

  5. #5
    Registered User
    Join Date
    10-09-2014
    Location
    Cork,Ireland
    MS-Off Ver
    2010
    Posts
    3

    Re: Macro to download a file by click a button on internet link

    Ok Thank you

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to download a file by click a button on internet link

    Hello NorrenDeasy,

    This might get you going in the right direction. The macro below assumes the button to be clicked is on the login page.

    Since you didn't say which page the button is actually on, this is a guide to help you modify your code. Fortunately, the web designer had the presence of mind to use the ID property when writing the code.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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: 3
    Last Post: 06-03-2014, 12:53 PM
  2. Download CSV file from https:// internet
    By chinraj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-11-2014, 08:23 AM
  3. VBA - IE - click on "Open" in an internet explorer "file download" window
    By victoire in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-22-2013, 07:08 AM
  4. Download the File from link
    By simi in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-12-2012, 01:32 PM
  5. Download a CSV file from an internet site
    By Microchip in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-28-2006, 07:45 AM

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