none
Export data to Word RRS feed

  • Question

  • Hi everyone,

    I am doing a template in excel where I want to export the data automatically to a word I already created (like a report) and to write the data where I want. I have seen this website http://desref.com/pasar-datos-de-excel-a-word-con-macros-vba-mejor-metodo/ but I cannot make it work.

    Thanks

    Monday, July 30, 2018 11:51 AM

Answers

  • Hello Ignasi20,

    The error is that Variable is not defined that means you need defined the patharch varibale first.

    Check the top of the module, there should be a line code "Option Explicit". The function of the code is requiring all the variables in the module need to be defined and your code have many variable not defined, so I will suggest you delete the "Option Explicit" to continue your macro.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Ignasi20 Wednesday, August 1, 2018 6:19 AM
    Tuesday, July 31, 2018 7:51 AM

All replies

  • Hi,

    What was your error? Where did you fail?

    Thanks,

    Mahmood

    Monday, July 30, 2018 6:19 PM
  • Hello Ignasi20,

    What's your sheet data and what's your own need?

    What do you mean cannot make it work? Did you fail to run your code or the macro did not get the result you want?

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, July 31, 2018 2:42 AM
  • 

    What I would like to do is insert this sentences where they belong ("Punt_1, Punt_2.....")

    Tuesday, July 31, 2018 6:58 AM
  • 

    I am not familiar with this kind of macros so I don't know how to define this variables and what do they mean so I cannot work on the problem.

    You can't see it in the image, but in the Word template I have "Punt_1, Punt_2..." which is where I want to insert the data

    • Edited by Ignasi20 Tuesday, July 31, 2018 7:18 AM
    Tuesday, July 31, 2018 7:10 AM
  • Hello Ignasi20,

    The error is that Variable is not defined that means you need defined the patharch varibale first.

    Check the top of the module, there should be a line code "Option Explicit". The function of the code is requiring all the variables in the module need to be defined and your code have many variable not defined, so I will suggest you delete the "Option Explicit" to continue your macro.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Ignasi20 Wednesday, August 1, 2018 6:19 AM
    Tuesday, July 31, 2018 7:51 AM