+ Reply to Thread
Results 1 to 15 of 15

Hyperlink to workbook will not open when run as part of macro

  1. #1
    Registered User
    Join Date
    12-08-2015
    Location
    Cincinnati
    MS-Off Ver
    365
    Posts
    26

    Hyperlink to workbook will not open when run as part of macro

    Hello.

    I have a hyperlink to a workbook set to open as part of a macro. When I run the macro the file never opens. Excel just pauses and shows the hourglass and then it goes away. If I click the hyperlink, the linked workbook opens just fine.

    If I set the hyperlink to open a word doc and then run the macro it opens the word doc just fine.

    Could this be an excel setting?

    It has been very frustrating, any help would be appreciated.

    The code I used to open the hyperlink is:

    Please Login or Register  to view this content.
    Last edited by jdutle; 12-15-2015 at 06:18 PM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Hyperlink to workbook will not open when run as part of macro

    Please edit your original post and add code tags to the code.

    AA CodeTags.jpg

  3. #3
    Registered User
    Join Date
    12-08-2015
    Location
    Cincinnati
    MS-Off Ver
    365
    Posts
    26

    Re: Hyperlink to workbook will not open when run as part of macro

    It seems to just highlight rows based on the number of rows of data there are in column A

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Hyperlink to workbook will not open when run as part of macro

    Quote Originally Posted by jdutle View Post
    It seems to just highlight rows based on the number of rows of data there are in column A
    Yep..... but I was showing you how to edit your post to add code tags to your code.

  5. #5
    Registered User
    Join Date
    12-08-2015
    Location
    Cincinnati
    MS-Off Ver
    365
    Posts
    26
    Quote Originally Posted by davesexcel View Post
    Yep..... but I was showing you how to edit your post to add code tags to your code.
    Duh, I'm sorry. I'm new to this. I know now for next time. Thanks!

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Hyperlink to workbook will not open when run as part of macro

    Quote Originally Posted by jdutle View Post
    ...I know now for next time......!
    You should still be able to edit it.

  7. #7
    Registered User
    Join Date
    12-08-2015
    Location
    Cincinnati
    MS-Off Ver
    365
    Posts
    26

    Re: Hyperlink to workbook will not open when run as part of macro

    Got it Thanks!

  8. #8
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Hyperlink to workbook will not open when run as part of macro

    Possibly
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    12-08-2015
    Location
    Cincinnati
    MS-Off Ver
    365
    Posts
    26

    Re: Hyperlink to workbook will not open when run as part of macro

    Darn no luck. It brought open the dialog box about making sure the link is from a trustworthy source, but when I click ok it does the same thing. The hour glass comes up excel pauses for a second and then nothing.

    If I click the hyperlink, the same dialog box comes up, I click ok and then the file opens.

    It makes no sense. The macro is taking place of acutally clickin the link, it should do the same thing, but doesnt

  10. #10
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Hyperlink to workbook will not open when run as part of macro

    Could you just use VBA to open the workbook instead of using a hyperlink?

  11. #11
    Registered User
    Join Date
    12-08-2015
    Location
    Cincinnati
    MS-Off Ver
    365
    Posts
    26

    Re: Hyperlink to workbook will not open when run as part of macro

    Technically yes, but I dont think it would be very user friendly to have to create a vba for each link. I have a summary sheet that have hyperlinks to many individual workbooks. They hyperlinks were meant to be an easy way for users to open and edit the individual workbooks. I was trying to keep them from having to find the file each time they wanted to open it.

  12. #12
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Hyperlink to workbook will not open when run as part of macro

    Why would the user have to select a file, could they not just open the file they click on?

  13. #13
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Hyperlink to workbook will not open when run as part of macro

    Do a web search on Removing Hyperlink Warnings, you will not be pleased with the results.

    Here is one solution.

    Remove the hyperlink , then use selection event to open the workbooks.
    The code goes into the worksheet module.

    RightClick.jpg

    This code does all that, you can also select the column then right click and select "Remove Hyperlinks"

    12-18-2015 1-17-00 AM.jpg
    Please Login or Register  to view this content.
    Last edited by davesexcel; 12-18-2015 at 03:18 AM.

  14. #14
    Registered User
    Join Date
    12-08-2015
    Location
    Cincinnati
    MS-Off Ver
    365
    Posts
    26

    Re: Hyperlink to workbook will not open when run as part of macro

    I was wanting to use the hyperlink so they would not have go in to the browswer to open the file, or do a file open.

    I did find a glimmer of hope. While in the VB editor, if I click the pause/break button, then hit resume, the macro will run just fine. It only work if I run it in VB, I tried to map the macro to a button after it was working, but outside of VB it behaves the same as before. Have you ever heard of anything like that? I did some searching, but couldn't find a conclusive answer.

  15. #15
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Hyperlink to workbook will not open when run as part of macro

    My last post shows you how to do it, you just have to click the cell and it will open the workbook.

+ 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. macro to open files and copy specific sheet into new workbook (have open files part)
    By dangerdavedsp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-04-2015, 02:23 PM
  2. Copy Data from Closed workbook (bbb.xls) to Open workbook (aaa.xls) (Part 2)
    By alexnkc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2013, 02:06 AM
  3. hyperlink to open workbook read only
    By shanermuls in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-10-2013, 06:35 AM
  4. Macro to replace part of hyperlink (New Request)
    By SeanPratt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-07-2013, 10:31 AM
  5. hyperlink wants to reopen already open workbook
    By nigelog in forum Excel General
    Replies: 1
    Last Post: 07-31-2009, 04:40 AM
  6. Macro to replace part of hyperlink
    By snoteborn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-26-2007, 02:08 PM
  7. Hyperlink To Open Workbook and Particular Tab (Sheet)..Possible?
    By Mhz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-14-2007, 09:26 AM

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