Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    External Links (97:SR2)

    I have an XL file that has external links and upon opening it the user is prompted to refresh the links. I would like to have code select "No" based upon the Application.UserName.

    What would be the best way to handle this?

    Thanks,
    John

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: External Links (97:SR2)

    John,

    I hope that one of the Excel gurus can help you, but I'm not optimistic. The question about updating links is asked before a Workbook_Open or Auto_Open macro is executed, so I don't know how to interact with the update prompt.

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: External Links (97:SR2)

    Hans,

    Thank you for taking a look at it. I'll have to wait until Monday.

    John

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: External Links (97:SR2)

    Follow-up: you can create a macro in another workbook that opens the workbook containing external links, and uses SendKeys to send the underlined character for "No".

    If Application.UserName = "jstevens" Then
    SendKeys "N"
    End If
    Workbooks.Open "C:ExcelMyWorkbookWithLinks.xls"

  5. #5
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: External Links (97:SR2)

    Instead of using sendkeys, you can use the UpdateLinks parameter of open:
    From the HELP
    <hr>UpdateLinks
    Optional Variant. Specifies the way links in the file are updated. If this argument is omitted, the user is prompted to specify how links will be updated. Otherwise, this argument is one of the values listed in the following table.

    Value Meaning
    0 Doesn't update any references
    1 Updates external references but not remote references
    2 Updates remote references but not external references
    3 Updates both remote and external references<hr>

    Steve

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: External Links (97:SR2)

    <img src=/S/doh.gif border=0 alt=doh width=15 height=15>

    Thanks! Much better!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •