I am trying to open a word template from excel using the vba code. The main logic of the code is that it opens a word template (that has the bookmarks in it) and the active workbook has 3 sheets such as setup sheet, dashboard sheet, codeinfo. The setup sheet has the details of the column number of the data to be populated from the sheet "dashboard sheet" and its bookmark name and its description. The dashboard sheet has the required data starting from row 4 to be populated to word document. the codeinfo sheet has the name of the template document and the name of the folder in which it saves the completed reports. My problem is that When I execute the following code it gives me an error "Run-time error: Application-defined or object-defined error" and stops the execution with one word document "Document 1" that follows the template populated with value. The error happens while looping over the second row data and stops execution. Finally I get an error in the red line while looping for the second bmkname. Thanks.
Please find the attached workbook. I am not able to upload the word template (.dotx) file since it is not supporting. Please help.![]()
Please Login or Register to view this content.
Bookmarks