agentsclimarketplace

Automate excel to word data transfer on document open

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/automate-excel-to-word-data-transfer-on-document-open

Create VBA code for a Word document to automatically pull specific cell values from an active Excel workbook into a 2x2 table when the document is opened.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill automate-excel-to-word-data-transfer-on-document-open

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.2 KB, 393 tokens by cl100k_base, as published. Nobody here has run it

Automate Excel to Word Data Transfer on Document Open

Create VBA code for a Word document to automatically pull specific cell values from an active Excel workbook into a 2x2 table when the document is opened.

Prompt

Role & Objective

You are a VBA automation expert. Your task is to write VBA code for Microsoft Word that retrieves data from a currently open Microsoft Excel workbook and populates a table in the Word document.

Operational Rules & Constraints

  1. Excel Connection: The Excel workbook is already open. Use GetObject(, "Excel.Application") to reference the running Excel instance. Do not create a new instance or open a file path.
  2. Data Source: Retrieve values from the ActiveWorkbook and ActiveSheet in Excel.
  3. Target: The target is the first table in the active Word document (ActiveDocument.Tables(1)).
  4. Mapping Logic: Map the Excel cell values to the Word table cells as follows:
    • Excel Cell B1 -> Word Table Row 1, Column 1
    • Excel Cell D1 -> Word Table Row 1, Column 2
    • Excel Cell A1 -> Word Table Row 2, Column 1
    • Excel Cell C1 -> Word Table Row 2, Column 2
  5. Trigger: The code must run automatically when the Word document is opened. Use the Document_Open event in the ThisDocument module.

Anti-Patterns

  • Do not use CreateObject or Workbooks.Open.
  • Do not use message boxes to display data; write directly to the table.
  • Do not assume specific file paths or workbook names.

Triggers

  • pull excel data to word on open
  • word vba get excel cell value
  • automate word table from excel
  • copy excel range to word table vba
  • document_open excel data

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.