+ Reply to Thread
Results 1 to 9 of 9

Fire Excel Macro Only IF Specific URL Change, Exit Sub IF Not This URL

  1. #1
    Registered User
    Join Date
    10-29-2010
    Location
    Saint Louis, MO USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Fire Excel Macro Only IF Specific URL Change, Exit Sub IF Not This URL

    Fire Macro Only IF Specific URL Address Change Is Requested From WebBrowser Object?

    I am using a WebBrowser Sub that runs a macro when the URL Address changes.

    The problem is it fires the macro each time the browser is refreshed because it changes (or refreshes back to itself and runs the macro).

    I would like the macro only to run ONLY when a SPECIFIED URL is requested.



    The code beneath works great.
    All are welcome to try this code for yourself (click on the developer tab>insert tools>more tools>microsoft web browser>draw browser>paste code beneath in vba)
    Please Login or Register  to view this content.


    The only problem is (as stated above), it launches each time the page is opened or refreshed. I am in need of a way to code this the right way so that it only runs the macro if a specified URL address is requested only. This way the macro will not fire up at start up or when the page is refreshed, but yet only when the specified page is loaded with the web browser.

    Please Login or Register  to view this content.
    cross post link: http://www.dbforums.com/microsoft-ex...ml#post6483450
    Can anyone help me with the correct working syntax for this code?
    Last edited by indi visual; 10-29-2010 at 10:18 PM. Reason: rule compliance

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Fire Excel Macro Only IF Specific URL Change, Exit Sub IF Not This URL

    also cross posted at MrExcel - with links to others:

    http://www.mrexcel.com/forum/showthread.php?t=505461

    In terms of why we ask you to detail all of the cross posts: http://www.excelguru.ca/node/7

  3. #3
    Registered User
    Join Date
    10-29-2010
    Location
    Saint Louis, MO USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Fire Excel Macro Only IF Specific URL Change, Exit Sub IF Not This URL

    all cross post links (8 total): I am checking any every one of them with follow up questions (responses), and I will mark them all as solved once I implement the solution tip top. I thank anyone in advance for any resolution, and for all feed back thus far. I saved these links because my heart was in the right place to mark all of these as solved, but I honestly didn't know that developers check other forums as well. Sincerely: Indi Visual

    http://www.access-programmers.co.uk/...75#post1012675
    http://forums.anandtech.com/showthre...3#post30682733
    http://www.dbforums.com/microsoft-ex...ml#post6483450
    http://www.excelforum.com/excel-gene...ml#post2409449
    http://social.answers.microsoft.com/...7-06fe60958da7
    http://social.technet.microsoft.com/...5-871e9a936f3c
    http://www.mrexcel.com/forum/showthr...67#post2494267
    http://www.xtremevbtalk.com/showthread.php?p=1372719

  4. #4
    Registered User
    Join Date
    10-29-2010
    Location
    Saint Louis, MO USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Fire Excel Macro Only IF Specific URL Change, Exit Sub IF Not This URL

    It is not my intention to mislead or confuse, I do enough of that to myself when it comes to this stuff : )
    Last edited by indi visual; 10-30-2010 at 02:23 PM. Reason: Deletion Needed

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Fire Excel Macro Only IF Specific URL Change, Exit Sub IF Not This URL

    Quote Originally Posted by indi visual View Post
    I honestly didn't know that developers check other forums as well.
    Sincerity aside the above is wholly irrelevant.

    People contribute their own spare time free of charge.

    By cross posting and not providing all links you are increasing the likelihood that those same people are wasting their time* - time that could have been spent helping others
    *resolving a problem which unbeknownst to them has been resolved elsewhere

    Put simply we ask you do not abuse the good nature of those trying to assist you - thank you for providing all the links above.

  6. #6
    Registered User
    Join Date
    10-29-2010
    Location
    Saint Louis, MO USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Fire Excel Macro Only IF Specific URL Change, Exit Sub IF Not This URL

    I have a question only posted here for you DonkeyOte.

    At this point (considering I may have ruined my chances of any resolution on this), what are my options with getting help at this point?

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Fire Excel Macro Only IF Specific URL Change, Exit Sub IF Not This URL

    Well I note you have had some assistance on your XVBT - I would suggest you persevere with that thread.
    You will be hard pushed to find someone better able to assist you than Colin Legg - however many forums you post the question to.

  8. #8
    Registered User
    Join Date
    10-29-2010
    Location
    Saint Louis, MO USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Fire Excel Macro Only IF Specific URL Change, Exit Sub IF Not This URL

    Thanks. I think just knowing that you knew Colin, and that I was in the right place as far as experienced expertise helps. It actually made me feel a lot better that you knew who he was. Thanks for the peace of mind.

  9. #9
    Registered User
    Join Date
    10-29-2010
    Location
    Saint Louis, MO USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Fire Excel Macro Only IF Specific URL Change, Exit Sub IF Not This URL

    SOLVED.
    DONE.
    FINISHED.
    VICTORY! : )

    Resolution originally posted beneath:
    http://www.mrexcel.com/forum/showthr...16#post2494916



    Chandoo|KeyMaster at Chandoo.org
    Hui at Chandoo.org
    DonkeyOte at ExcelForum.com
    Rik_UK at SocialAnswers.Microsoft.com
    FlyGuy|Lost Soul at XtremeVBTalk.com
    Peter_SSs at Mr.Excel.com
    John_w at Mr.Excel.com
    Norie at Mr.Excel.com


    and last but certaintly not least a tremendous thank you to Mr.
    Colin Legg at Mr.Excel
    for helping me with the finishing touches to actually pull this off.

    I appreciated everyone's help on this, and so far this only tested for one button, but the victory was well worth it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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