Forum Discussion

johngallagher's avatar
johngallagher
Copper Contributor
Sep 21, 2023

Link excel cell to downloadable document

Hello everyone,

 

Apologies for improper formatting or confusing wording for my question. 

 

I'm trying to link a downloadable word worksheet into excel in a way that a copy of the original word file will be downloaded each time it is accessed from excel. I want multiple users to click on the word link and fill out the forms without editing the original copy. They will primarily be interfacing with this through office 365. 

I'd appreciate any advice, or if you have an alternative recommendation for accomplishing my tas!

 

Thank you.

  • LeonPavesic's avatar
    LeonPavesic
    Sep 21, 2023

    Hi johngallagher,

    Unfortunately, there is no direct way to create a link in Excel that will open a copy of the Word document immediately. When a user clicks on a hyperlink in Excel, they will always be taken to the original document, regardless of whether it is stored locally or online.

    You can try to use a workaround with macro in Excel that will download the Word document and open it in a new window:

    1. Open the Excel workbook where you want to add the macro.
    2. Press Alt + F11 to open the Visual Basic Editor (VBE).
    3. In the VBE, click Insert > Module.
    4. In the new module window, paste the following code:

     

    Sub DownloadAndOpenWordDocument()
    
    'Declare variables
    Dim wordApp As Object
    Dim wordDoc As Object
    Dim downloadPath As String
    
    'Create a new instance of the Word application
    Set wordApp = CreateObject("Word.Application")
    
    'Get the path to the Word document to download
    downloadPath = "https://example.com/my-word-document.docx"
    
    'Download the Word document
    Set wordDoc = wordApp.Documents.Open(downloadPath)
    
    'Open the Word document in a new window
    wordDoc.Visible = True
    
    End Sub​

     

    Click the Save button to save the macro.

      1. To assign the macro to a button, click Insert > Shapes and select the shape of the button you want to use.
      2. Right-click on the button and select Assign Macro.
      3. In the Assign Macro dialog box, select the DownloadAndOpenWordDocument macro and click Assign.
      4. To assign the macro to a keyboard shortcut, click Tools > Customize.
      5. In the Customize dialog box, click the Commands tab.
      6. In the Categories list, select Macros.
      7. In the Macros list, select the DownloadAndOpenWordDocument macro.
      8. Click the Assign Shortcut Key button.
      9. Press the keyboard shortcut you want to assign to the macro and click Assign.
      10. Click Close to close the Customize dialog box.

      Now, when you click on the button or press the keyboard shortcut, the macro will run and download the Word document. The Word document will then open in a new window, where you can fill out the form and save it.



      Please click Mark as Best Response & Like if my post helped you to solve your issue.
      This will help others to find the correct solution easily. It also closes the item.


      If the post was useful in other ways, please consider giving it Like.


      Kindest regards,


      Leon Pavesic

  • LeonPavesic's avatar
    LeonPavesic
    Silver Contributor

    Hi johngallagher,

    Yes, you can create a link in Excel that allows users to download a Word document without editing the original copy. Here are the instructions:

    1. Save the Word document in a shared location (such as OneDrive or SharePoint or even a shared folder).
    2. In Excel, select the cell where you want to insert the link and click "Insert" > "Hyperlink".
    3. In the "Insert Hyperlink" dialog box, select "Existing File or Web Page" and enter the URL to the Word document.
    4. Click "OK" to create the link.

    When a user clicks the link, they will be prompted to download a copy of the Word document. The original Word file will remain unchanged.

    Here is a link to a Microsoft support article on how to create hyperlinks in Excel: https://support.microsoft.com/en-au/office/hyperlink-function-333c7ce6-c5ae-4164-9c47-7de9b76f577f


    Please click Mark as Best Response & Like if my post helped you to solve your issue.
    This will help others to find the correct solution easily. It also closes the item.


    If the post was useful in other ways, please consider giving it Like.


    Kindest regards,


    Leon Pavesic

    • johngallagher's avatar
      johngallagher
      Copper Contributor
      Thank you for your response!

      When I follow those steps and click the link within the excel sheet, it takes me to the online word document. I realize users could then choose to "download a copy" of the document, but I would like to remove that step and allow them to just open a copy immediately if possible.
      • LeonPavesic's avatar
        LeonPavesic
        Silver Contributor

        Hi johngallagher,

        Unfortunately, there is no direct way to create a link in Excel that will open a copy of the Word document immediately. When a user clicks on a hyperlink in Excel, they will always be taken to the original document, regardless of whether it is stored locally or online.

        You can try to use a workaround with macro in Excel that will download the Word document and open it in a new window:

        1. Open the Excel workbook where you want to add the macro.
        2. Press Alt + F11 to open the Visual Basic Editor (VBE).
        3. In the VBE, click Insert > Module.
        4. In the new module window, paste the following code:

         

        Sub DownloadAndOpenWordDocument()
        
        'Declare variables
        Dim wordApp As Object
        Dim wordDoc As Object
        Dim downloadPath As String
        
        'Create a new instance of the Word application
        Set wordApp = CreateObject("Word.Application")
        
        'Get the path to the Word document to download
        downloadPath = "https://example.com/my-word-document.docx"
        
        'Download the Word document
        Set wordDoc = wordApp.Documents.Open(downloadPath)
        
        'Open the Word document in a new window
        wordDoc.Visible = True
        
        End Sub​

         

        Click the Save button to save the macro.

          1. To assign the macro to a button, click Insert > Shapes and select the shape of the button you want to use.
          2. Right-click on the button and select Assign Macro.
          3. In the Assign Macro dialog box, select the DownloadAndOpenWordDocument macro and click Assign.
          4. To assign the macro to a keyboard shortcut, click Tools > Customize.
          5. In the Customize dialog box, click the Commands tab.
          6. In the Categories list, select Macros.
          7. In the Macros list, select the DownloadAndOpenWordDocument macro.
          8. Click the Assign Shortcut Key button.
          9. Press the keyboard shortcut you want to assign to the macro and click Assign.
          10. Click Close to close the Customize dialog box.

          Now, when you click on the button or press the keyboard shortcut, the macro will run and download the Word document. The Word document will then open in a new window, where you can fill out the form and save it.



          Please click Mark as Best Response & Like if my post helped you to solve your issue.
          This will help others to find the correct solution easily. It also closes the item.


          If the post was useful in other ways, please consider giving it Like.


          Kindest regards,


          Leon Pavesic

Resources