+ Reply to Thread
Results 1 to 13 of 13

Trouble With Hyperlinks

  1. #1
    Registered User
    Join Date
    07-28-2015
    Location
    Danville, IL USA
    MS-Off Ver
    2013
    Posts
    34

    Trouble With Hyperlinks

    Greetings,

    I am having great difficulty with the Hyperlinks Method.

    I have a workbook where the user fills in summary information and then clicks a command button which takes that information, copies it to the appropriate fields on a template (a separate workbook), and then saves the new workbook with the next consecutive number as the file name. All this works just fine.

    The next sub in my macro is supposed to create a hyperlink from the active cell to the newly created workbook which is in a sub directory under the directory where the summary workbook resides.

    Here's my code:

    Please Login or Register  to view this content.
    This runs until I get to the line in purple text, at which point it hangs and produces a "Run-time error '1004': Application-defined or object-defined error.

    Any help at all would be appreciated. I've been working on this one line of code for 3 days now with no luck whatsoever.

    Thanks,
    ~ Phil

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trouble With Hyperlinks

    Some ideas:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-28-2015
    Location
    Danville, IL USA
    MS-Off Ver
    2013
    Posts
    34

    Re: Trouble With Hyperlinks

    JBeaucaire,

    Thank you for your suggestion and I apologize for my delayed response. I got pulled into another project for a few days.

    Unfortunately, your code hung at the creation of the hyperlink too. If you have any other suggestions, I would love to hear them.

    In the mean time I will continue to try to beat it into submission!

    Thanks again,
    ~ Phil

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trouble With Hyperlinks

    Can you post a sample workbook with sample data in it, one that you've confirmed the same 'hanging' is happening with the sample data. Then I can test the issue directly for you.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  5. #5
    Registered User
    Join Date
    07-28-2015
    Location
    Danville, IL USA
    MS-Off Ver
    2013
    Posts
    34

    Re: Trouble With Hyperlinks

    Thanks for your continued assistance.

    Since my project involves workbooks in two different directories, I have used the .zip format to preserve the directory structure. The Q:\ drive referred to in the code is a network drive here at work. I don't know what impact that has on your ability to manipulate the files. The password to unlock the VBA project and the protected worksheet is "atholl" (no quotes).

    I have also included a .doc file which is the instructions for the end user.

    There really isn't anything proprietary in here, although you can see my full real name in the path of the network drive.

    I know my code is sloppy, and have come to realize that I should be working in a module, not in Sheet1. I'm still learning VBA and unfortunatley, I don't get to use it frequently enough to facilitate good learning. I frequently find that what works in the lessons & books I'm studying from doesn't always work as well in the real world.

    Thanks again for investing your time in helping a newbie out.

    ~ Phil
    Attached Files Attached Files

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trouble With Hyperlinks

    SUB SAVE_AS

    References Worksheets("Rev #")
    This worksheet does not exist in the workbook.

  7. #7
    Registered User
    Join Date
    07-28-2015
    Location
    Danville, IL USA
    MS-Off Ver
    2013
    Posts
    34

    Re: Trouble With Hyperlinks

    That is the name of Sheet1 in the templates. I'm grabbing my file name from cell AO9 in the template.

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trouble With Hyperlinks

    This worked for me:
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    07-28-2015
    Location
    Danville, IL USA
    MS-Off Ver
    2013
    Posts
    34

    Re: Trouble With Hyperlinks

    Sorry for the delay. I got pulled off onto another project ...

    SO I tried your code and it still produces the same error when attempting to create the hyperlink.

    Run-time error 1004, Application defined or Object defined error.

    I've also checked with our network admin and confirmed that there is nothing in our network security preventing the creation of hyperlinks.

    Thanks for your time.

  10. #10
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Trouble With Hyperlinks

    Please Login or Register  to view this content.
    The use of 'activeworkbook' is always tricky since you can't be 100% sure which is the activeworkbook.
    The content of .Range("AO9") might contain a problem too.
    I refrain from using 'activate'.
    I built 2 checks (msgboxes).
    Last edited by snb; 05-15-2017 at 12:34 PM.



  11. #11
    Registered User
    Join Date
    07-28-2015
    Location
    Danville, IL USA
    MS-Off Ver
    2013
    Posts
    34

    Thumbs up Re: Trouble With Hyperlinks

    Solved!

    As usual (at least in my case) it was something simple. The cell I was trying to anchor the hyperlink to was protected. Duh!

    This code runs and does what it's supposed to now.

    Please Login or Register  to view this content.
    Thank you again for your time and patience.
    My apologies for not catching my boneheaded error sooner.

    ~ Phil

  12. #12
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trouble With Hyperlinks

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  13. #13
    Registered User
    Join Date
    07-28-2015
    Location
    Danville, IL USA
    MS-Off Ver
    2013
    Posts
    34

    Re: Trouble With Hyperlinks

    Thanks.

    I was looking for a way to do that but couldn't find it.

+ 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. [SOLVED] Range containing many hyperlinks is default blue font -fix to be black but keep hyperlinks
    By RedSummer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2015, 12:01 PM
  2. Find Hyperlinks, Copy Hyperlinks to alternative sheet, print all hyperlinks
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-13-2013, 05:13 PM
  3. Replies: 7
    Last Post: 06-14-2012, 09:44 AM
  4. Having trouble creating subfolders and hyperlinks
    By d.howard in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-13-2010, 06:01 PM
  5. Replies: 0
    Last Post: 05-14-2006, 11:45 PM
  6. [SOLVED] Trouble with hyperlinks (repost)
    By [email protected] in forum Excel General
    Replies: 2
    Last Post: 03-23-2006, 02:00 PM
  7. Trouble with hyperlinks
    By [email protected] in forum Excel General
    Replies: 0
    Last Post: 03-17-2006, 07:15 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