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 ...
  • 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

Resources