+ Reply to Thread
Results 1 to 9 of 9

hyperlink error on saving

  1. #1
    Registered User
    Join Date
    08-05-2009
    Location
    Ballarat Australia
    MS-Off Ver
    Excel 2007
    Posts
    65

    hyperlink error on saving

    Hi All,

    I have a macro that when run, copies a master sheet, opens a new workbook pastes the copied data, saves & re names the new worksheet & workbook and adds information to a register in the 1st workbook with a hyperlink to the new workbook.

    The problem I cant get passed is the hyperlink will only open the folder my new workbook is saved in not the file (obviously I have not got it quite right), I have tried for about 3 days to get it to work looking at other posts here & I can get it to work if I save as a PDF type file but not as an excel type..

    I need to be able to bring up the new workbook to add new orders to it from time to time.

    Thanks for looking Rex.

    HTML Code: 
    Draft Sealing Agg Reg 1.xlsm
    Last edited by nighttrainrex; 03-18-2012 at 07:20 PM.

  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: hyperlink error on saving

    I would suggest using the HYPERLINK formula is far less tedious. Here's a slimmed down version of your macro, all the unnecessary activating and selecting has been removed.

    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
    08-05-2009
    Location
    Ballarat Australia
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: hyperlink error on saving

    Hi Jbeaucaire,

    thanks for the reply & the work you have done,

    I have copied & tried your new code. I get a Run-Time error 1004 - Method 'Breaklink of object _ Workbook Failed at this line of code

    HTML Code: 
    Any ideas on this?

    cheers Rex

  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: hyperlink error on saving

    Try this instead:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-05-2009
    Location
    Ballarat Australia
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: hyperlink error on saving

    Ok tried that but get the same result, for your info, the link needs to break to stop the trace or indexing number from changing on the new sheet. at the moment I have it so that on the "Register" sheet I have in B2 the following formula SUM(DMAX(A2:A513,A2,A2:A513)+1) this is copied to the "Master" sheet to have the next available number. perhaps there is a better way to index the master sheet number?

  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: hyperlink error on saving

    That second method works for me. Odd.

    So, we're just wanting a "flat" workbook with no formulas, that's easy enough, let's go another route:
    Please Login or Register  to view this content.

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
    Last edited by JBeaucaire; 03-18-2012 at 07:32 PM.

  7. #7
    Registered User
    Join Date
    08-05-2009
    Location
    Ballarat Australia
    MS-Off Ver
    Excel 2007
    Posts
    65

    Thumbs up Re: hyperlink error on saving

    sorrry for the delay in getting back to this - weekend,

    ok 1st up I may have miss informed my needs I do require the formulas to stay all except the link between the master sheet & the new sheet number, with that in mind before I try you new code, i have played around with the 1st one changed a few lines & it is working fine

    changed code to this
    HTML Code: 
    Thank you very much for your time much appreciated

    cheers Rex
    Last edited by nighttrainrex; 03-18-2012 at 07:19 PM.

  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: hyperlink error on saving

    30 seconds of Googling:

    FileFormat codes:
    51 = xlOpenXMLWorkbook (without macro's in 2007, .xlsx)
    52 = xlOpenXMLWorkbookMacroEnabled (with or without macro's in 2007, .xlsm)
    50 = xlExcel12 (Excel Binary Workbook in 2007 with or without macro's, .xlsb)
    56 = xlExcel8 (97-2003 format in Excel 2007, .xls)

  9. #9
    Registered User
    Join Date
    08-05-2009
    Location
    Ballarat Australia
    MS-Off Ver
    Excel 2007
    Posts
    65

    Re: hyperlink error on saving

    Thanks very mush all working fine now

    Thank you for your efforts

    regards Rex

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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