• Open Web Page via Add-In (Excel 2003)

    Author
    Topic
    #457445

    Hi all, and thanks for you time.

    I have been asked to add a bit of functionality to an existing Excel xla, and I’m wondering about the best way to do it.

    It’s a sub-menu to be added to an existing menu, displaying a list of intranet help pages. Selecting a page from the list should open it in the browser.

    I haven’t used VBA to open a web page before – Googling got me:
    Activeworkbook.FollowHyperlink address, NewWindow:= false
    which worked fine initially, but I had to allow for the possibility of no active workbook.

    With some trepidation I changed it to
    ThisWorkbook.FollowHyperlink …
    So the parent would be the xla workbook, and running it crashed Excel every time.

    Following a hyperlink entered in a cell on a worksheet in the xla likewise crashes me.

    Any help would be greatly appreciated.

    Thanks,

    Viewing 0 reply threads
    Author
    Replies
    • #1147004

      Welcome to Woody’s Lounge!

      Using ThisWorkbook.FollowHyperlink should work from an add-in, even if no workbook is open. See the add-in in the attached zip file.

      • #1147097

        Thanks very much, Hans. This works perfectly, and the test I tried that crashed it yesterday now works as well. Perhaps I was just in need of a reboot at the time. Would no doubt have wasted a lot of time without your help.
        Best,

    Viewing 0 reply threads
    Reply To: Open Web Page via Add-In (Excel 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: