+ Reply to Thread
Results 1 to 5 of 5

change address via macro

  1. #1
    Registered User
    Join Date
    05-25-2016
    Location
    Paris
    MS-Off Ver
    2010
    Posts
    4

    change address via macro

    Hi all,
    I have an excel sheet with several incorrect hyperlink.
    I would like to create a macro that:
    - You press hyperlink on cell
    - The address is passed to a macro
    - The macro returns the correct address
    - and jpg file is opened with correct link

    example
    hyperlink to "c:\OldFolder\image.jpg" ===> OldFolder doesn't exist
    and macro return "c:\NewFolder\image.jpg" ===> that exists

    The links are not sorted, they are scattered everywhere
    How can I do?


    thank you very much
    for any suggestions

    K.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: change address via macro

    How will the macro determine the correct address/link?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    05-25-2016
    Location
    Paris
    MS-Off Ver
    2010
    Posts
    4

    Re: change address via macro

    Hi Noire,
    thks for the reply,
    the macro should know the operating system.
    If I use W7, return a string, If I use XP, return another.
    thks

    EDIT:
    for instance in this way
    https://msdn.microsoft.com/en-us/lib.../ff837365.aspx
    Last edited by Keisy; 05-25-2016 at 09:56 AM.

  4. #4
    Registered User
    Join Date
    05-25-2016
    Location
    Paris
    MS-Off Ver
    2010
    Posts
    4

    Re: change address via macro

    For now, I used Worksheet_FollowHyperlink.
    Within this:
    - I take the name of the file
    - I pass it to a custom function that is responsible to evaluate the operating system
    - Return the correct path
    - Replace the address with Application.ActiveCell.Hyperlinks (1) .Address = ......

    However, I would like to replace hyperlink before it is launched.
    because at the first click on hyperlink it takes the old address!

    How can this be?

    .. in practice I have to update the hyperlink address before the click is successful! This is my problem now..

    thks
    Last edited by Keisy; 05-25-2016 at 02:07 PM.

  5. #5
    Registered User
    Join Date
    05-25-2016
    Location
    Paris
    MS-Off Ver
    2010
    Posts
    4

    Re: change address via macro

    Hi,
    maybe I solved it, but I have a problem.

    When I try to open this macro in Calc I get error in this line:
    obj = Application.OperatingSystem


    How can I fix?
    in Excel works fine!

    thks
    K.

+ 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 Change FROM Address in MS Outlook
    By harish.chinni in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2014, 02:21 AM
  2. Using macro to find email address in address book of Outlook
    By danfullwood in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2014, 06:48 AM
  3. change proxy address via vba
    By Lloyd Blankfein in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2013, 11:10 AM
  4. [SOLVED] Macro to find sign "@" and change format of email address
    By xtasio in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-22-2012, 04:17 AM
  5. Change email address to hyperlink w/Macro
    By dkub in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-26-2011, 12:20 PM
  6. [SOLVED] Change IP address with macro
    By broogle in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-07-2005, 09:05 PM
  7. [SOLVED] Unknown address change
    By Otto Moehrbach in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-05-2005, 04:06 PM

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