Forum Discussion

AAllen111's avatar
AAllen111
Copper Contributor
May 01, 2023

How do I update a new URL in Excel Workbook MACRO

Hi,

 

My company updated the URL for a tool used in an excel workbook. The person who created the excel workbook is no longer with us. How do I update this new URL, which is crucial to function of the queries, in the excel workbook?

  • NikolinoDE's avatar
    NikolinoDE
    Gold Contributor

    AAllen111 

    To update a URL used in an Excel macro, follow these steps:

    1. Open the Excel workbook that contains the macro.
    2. Press Alt + F11 to open the Visual Basic Editor.
    3. In the Project Explorer window on the left, find and expand the module that contains the macro code.
    4. Look for the line of code that contains the URL. It may be in the form of a variable or a string.
    5. Replace the old URL with the new URL.
    6. Save the changes to the macro code.
    7. Close the Visual Basic Editor.

    If the URL is referenced in multiple locations in the workbook, you may need to search for it using Excel's "Find and Replace" feature and update it in all relevant places.

    It's important to note that if the macro code is password-protected, you will need to know the password in order to make changes to it. If the original creator of the macro is no longer available and you don't have the password, you may need to recreate the macro from scratch or you need to remove the password ( Password options ).

     

    NikolinoDE

    I know I don't know anything (Socrates)

Resources