[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BVRT3X4N4XSH9TQF7PZAFS":3,"skill-same:01M7BVRT3X4N4XSH9TQF7PZAFS":82},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":57,"repositoryHtmlUrl":58,"repositoryHomepageUrl":6,"ownerHtmlUrl":59,"ownerBlogUrl":6,"ownerDescription":60,"updatedAt":61,"install":62,"resources":75},"01M7BVRT3X4N4XSH9TQF7PZAFS","excel-automation",null,">","om-scogo\u002Fskillsh-scraper","om-scogo","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F160466840?v=4","01M79AWB6DFVCQ7RK70CS34B96","Om Achrekar","01M79AWB6ZM9SKR8KDH1WSSM22",0,"MIT","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fclaude-office-skills-skills\u002Fexcel-automation\u002FSkill.md",[],[],"2026-11-15 14:19:17",false,"---\n# ═══════════════════════════════════════════════════════════════════════════════\n# CLAUDE OFFICE SKILL - Enhanced Metadata v2.0\n# ═══════════════════════════════════════════════════════════════════════════════\n\n# Basic Information\nname: excel-automation\ndescription: \">\"\nversion: \"1.0\"\nauthor: claude-office-skills\nlicense: MIT\n\n# Categorization\ncategory: spreadsheet\ntags:\n  - excel\n  - automation\n  - macro\n  - workflow\ndepartment: All\n\n# AI Model Compatibility\nmodels:\n  recommended:\n    - claude-sonnet-4\n    - claude-opus-4\n  compatible:\n    - claude-3-5-sonnet\n    - gpt-4\n    - gpt-4o\n\n# MCP Tools Integration\nmcp:\n  server: office-mcp\n  tools:\n    - read_xlsx\n    - create_xlsx\n    - apply_formula\n    - pivot_table\n\n# Skill Capabilities\ncapabilities:\n  - automation\n  - data_processing\n  - reporting\n\n# Language Support\nlanguages:\n  - en\n  - zh\n---\n\n# Excel Automation Skill\n\n## Overview\n\nThis skill enables advanced Excel automation using **xlwings** - a library that can interact with live Excel instances. Unlike openpyxl (file-only), xlwings can control Excel in real-time, execute VBA, update dashboards, and automate complex workflows.\n\n## How to Use\n\n1. Describe the Excel automation task you need\n2. Specify if you need live Excel interaction or file processing\n3. I'll generate xlwings code and execute it\n\n**Example prompts:**\n- \"Update this live Excel dashboard with new data\"\n- \"Run this VBA macro and get the results\"\n- \"Create an Excel add-in for data validation\"\n- \"Automate monthly report generation with live charts\"\n\n## Domain Knowledge\n\n### xlwings vs openpyxl\n\n| Feature | xlwings | openpyxl |\n|---------|---------|----------|\n| Requires Excel | Yes | No |\n| Live interaction | Yes | No |\n| VBA execution | Yes | No |\n| Speed (large files) | Fast | Slow |\n| Server deployment | Limited | Easy |\n\n### xlwings Fundamentals\n\n```python\nimport xlwings as xw\n\n# Connect to active Excel workbook\nwb = xw.Book.caller()  # From Excel add-in\nwb = xw.books.active   # Active workbook\n\n# Open specific file\nwb = xw.Book('path\u002Fto\u002Ffile.xlsx')\n\n# Create new workbook\nwb = xw.Book()\n\n# Get sheet\nsheet = wb.sheets['Sheet1']\nsheet = wb.sheets[0]\n```\n\n### Working with Ranges\n\n#### Reading and Writing\n```python\n# Single cell\nsheet['A1'].value = 'Hello'\nvalue = sheet['A1'].value\n\n# Range\nsheet['A1:C3'].value = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\ndata = sheet['A1:C3'].value  # Returns list of lists\n\n# Named range\nsheet['MyRange'].value = 'Named data'\n\n# Expand range (detect data boundaries)\nsheet['A1'].expand().value  # All connected data\nsheet['A1'].expand('table').value  # Table format\n```\n\n#### Dynamic Ranges\n```python\n# Current region (like Ctrl+Shift+End)\ndata = sheet['A1'].current_region.value\n\n# Used range\nused = sheet.used_range.value\n\n# Last row with data\nlast_row = sheet['A1'].end('down').row\n\n# Resize range\nrng = sheet['A1'].resize(10, 5)  # 10 rows, 5 columns\n```\n\n### Formatting\n```python\n# Font\nsheet['A1'].font.bold = True\nsheet['A1'].font.size = 14\nsheet['A1'].font.color = (255, 0, 0)  # RGB red\n\n# Fill\nsheet['A1'].color = (255, 255, 0)  # Yellow background\n\n# Number format\nsheet['B1'].number_format = '$#,##0.00'\n\n# Column width\nsheet['A:A'].column_width = 20\n\n# Row height\nsheet['1:1'].row_height = 30\n\n# Autofit\nsheet['A:D'].autofit()\n```\n\n### Excel Features\n\n#### Charts\n```python\n# Add chart\nchart = sheet.charts.add(left=100, top=100, width=400, height=250)\nchart.set_source_data(sheet['A1:B10'])\nchart.chart_type = 'column_clustered'\nchart.name = 'Sales Chart'\n\n# Modify existing chart\nchart = sheet.charts['Sales Chart']\nchart.chart_type = 'line'\n```\n\n#### Tables\n```python\n# Create Excel Table\nrng = sheet['A1'].expand()\ntable = sheet.tables.add(source=rng, name='SalesTable')\n\n# Refresh table\ntable.refresh()\n\n# Access table data\ntable_data = table.data_body_range.value\n```\n\n#### Pictures\n```python\n# Add picture\nsheet.pictures.add('logo.png', left=10, top=10, width=100, height=50)\n\n# Update picture from matplotlib\nimport matplotlib.pyplot as plt\nfig, ax = plt.subplots()\nax.plot([1, 2, 3], [1, 4, 9])\nsheet.pictures.add(fig, name='MyPlot', update=True)\n```\n\n### VBA Integration\n```python\n# Run VBA macro\nwb.macro('MacroName')()\n\n# With arguments\nwb.macro('MyMacro')('arg1', 'arg2')\n\n# Get return value\nresult = wb.macro('CalculateTotal')(100, 200)\n\n# Access VBA module\nvb_code = wb.api.VBProject.VBComponents('Module1').CodeModule.Lines(1, 10)\n```\n\n### User Defined Functions (UDFs)\n```python\n# Define a UDF (in Python file)\nimport xlwings as xw\n\n@xw.func\ndef my_sum(x, y):\n    \"\"\"Add two numbers\"\"\"\n    return x + y\n\n@xw.func\n@xw.arg('data', ndim=2)\ndef my_array_func(data):\n    \"\"\"Process array data\"\"\"\n    import numpy as np\n    return np.sum(data)\n\n# These become Excel functions: =my_sum(A1, B1)\n```\n\n### Application Control\n```python\n# Excel application settings\napp = xw.apps.active\napp.screen_updating = False  # Speed up\napp.calculation = 'manual'   # Manual calc\napp.display_alerts = False   # Suppress dialogs\n\n# Perform operations...\n\n# Restore\napp.screen_updating = True\napp.calculation = 'automatic'\napp.display_alerts = True\n```\n\n## Best Practices\n\n1. **Disable Screen Updating**: For batch operations\n2. **Use Arrays**: Read\u002Fwrite entire ranges, not cell-by-cell\n3. **Manual Calculation**: Turn off auto-calc during data loading\n4. **Close Connections**: Properly close workbooks when done\n5. **Error Handling**: Handle Excel not being installed\n\n## Common Patterns\n\n### Performance Optimization\n```python\nimport xlwings as xw\n\ndef batch_update(data, workbook_path):\n    app = xw.App(visible=False)\n    try:\n        app.screen_updating = False\n        app.calculation = 'manual'\n        \n        wb = app.books.open(workbook_path)\n        sheet = wb.sheets['Data']\n        \n        # Write all data at once\n        sheet['A1'].value = data\n        \n        app.calculation = 'automatic'\n        wb.save()\n    finally:\n        wb.close()\n        app.quit()\n```\n\n### Dashboard Update\n```python\ndef update_dashboard(data_dict):\n    wb = xw.books.active\n    \n    # Update data sheet\n    data_sheet = wb.sheets['Data']\n    for name, values in data_dict.items():\n        data_sheet[name].value = values\n    \n    # Refresh all charts\n    dashboard = wb.sheets['Dashboard']\n    for chart in dashboard.charts:\n        chart.refresh()\n    \n    # Update timestamp\n    from datetime import datetime\n    dashboard['A1'].value = f'Last Updated: {datetime.now()}'\n```\n\n### Report Generator\n```python\ndef generate_monthly_report(month, data):\n    template = xw.Book('template.xlsx')\n    \n    # Fill data\n    sheet = template.sheets['Report']\n    sheet['B2'].value = month\n    sheet['A5'].value = data\n    \n    # Run calculations\n    template.app.calculate()\n    \n    # Export to PDF\n    sheet.api.ExportAsFixedFormat(0, f'report_{month}.pdf')\n    \n    template.save(f'report_{month}.xlsx')\n```\n\n## Examples\n\n### Example 1: Live Dashboard Update\n```python\nimport xlwings as xw\nimport pandas as pd\nfrom datetime import datetime\n\n# Connect to running Excel\nwb = xw.books.active\ndashboard = wb.sheets['Dashboard']\ndata_sheet = wb.sheets['Data']\n\n# Fetch new data (simulated)\nnew_data = pd.DataFrame({\n    'Date': pd.date_range('2024-01-01', periods=30),\n    'Sales': [1000 + i*50 for i in range(30)],\n    'Costs': [600 + i*30 for i in range(30)]\n})\n\n# Update data sheet\ndata_sheet['A1'].value = new_data\n\n# Calculate profit\ndata_sheet['D1'].value = 'Profit'\ndata_sheet['D2'].value = '=B2-C2'\ndata_sheet['D2'].expand('down').value = data_sheet['D2'].formula\n\n# Update KPIs on dashboard\ndashboard['B2'].value = new_data['Sales'].sum()\ndashboard['B3'].value = new_data['Costs'].sum()\ndashboard['B4'].value = new_data['Sales'].sum() - new_data['Costs'].sum()\ndashboard['A1'].value = f'Updated: {datetime.now().strftime(\"%Y-%m-%d %H:%M\")}'\n\n# Refresh charts\nfor chart in dashboard.charts:\n    chart.api.Refresh()\n\nprint(\"Dashboard updated!\")\n```\n\n### Example 2: Batch Processing Multiple Files\n```python\nimport xlwings as xw\nfrom pathlib import Path\n\ndef process_sales_files(folder_path, output_path):\n    \"\"\"Consolidate multiple Excel files into one summary.\"\"\"\n    \n    app = xw.App(visible=False)\n    app.screen_updating = False\n    \n    try:\n        # Create summary workbook\n        summary_wb = xw.Book()\n        summary_sheet = summary_wb.sheets[0]\n        summary_sheet.name = 'Consolidated'\n        \n        headers = ['File', 'Total Sales', 'Total Units', 'Avg Price']\n        summary_sheet['A1'].value = headers\n        \n        row = 2\n        for file in Path(folder_path).glob('*.xlsx'):\n            wb = app.books.open(str(file))\n            data_sheet = wb.sheets['Sales']\n            \n            # Extract summary\n            total_sales = data_sheet['B:B'].api.SpecialCells(11).Value  # xlCellTypeConstants\n            total_units = data_sheet['C:C'].api.SpecialCells(11).Value\n            \n            # Calculate and write\n            summary_sheet[f'A{row}'].value = file.name\n            summary_sheet[f'B{row}'].value = sum(total_sales) if isinstance(total_sales, (list, tuple)) else total_sales\n            summary_sheet[f'C{row}'].value = sum(total_units) if isinstance(total_units, (list, tuple)) else total_units\n            summary_sheet[f'D{row}'].value = f'=B{row}\u002FC{row}'\n            \n            wb.close()\n            row += 1\n        \n        # Format summary\n        summary_sheet['A1:D1'].font.bold = True\n        summary_sheet['B:D'].number_format = '$#,##0.00'\n        summary_sheet['A:D'].autofit()\n        \n        summary_wb.save(output_path)\n        \n    finally:\n        app.quit()\n    \n    print(f\"Consolidated {row-2} files to {output_path}\")\n\n# Usage\nprocess_sales_files('\u002Fpath\u002Fto\u002Fsales\u002F', 'consolidated_sales.xlsx')\n```\n\n### Example 3: Excel Add-in with UDFs\n```python\n# myudfs.py - Place in xlwings project\n\nimport xlwings as xw\nimport numpy as np\n\n@xw.func\n@xw.arg('data', pd.DataFrame, index=False, header=False)\n@xw.ret(expand='table')\ndef GROWTH_RATE(data):\n    \"\"\"Calculate period-over-period growth rate\"\"\"\n    values = data.iloc[:, 0].values\n    growth = np.diff(values) \u002F values[:-1] * 100\n    return [['Growth %']] + [[g] for g in growth]\n\n@xw.func\n@xw.arg('range1', np.array, ndim=2)\n@xw.arg('range2', np.array, ndim=2)\ndef CORRELATION(range1, range2):\n    \"\"\"Calculate correlation between two ranges\"\"\"\n    return np.corrcoef(range1.flatten(), range2.flatten())[0, 1]\n\n@xw.func\ndef SENTIMENT(text):\n    \"\"\"Basic sentiment analysis (placeholder)\"\"\"\n    positive = ['good', 'great', 'excellent', 'amazing']\n    negative = ['bad', 'poor', 'terrible', 'awful']\n    \n    text_lower = text.lower()\n    pos_count = sum(word in text_lower for word in positive)\n    neg_count = sum(word in text_lower for word in negative)\n    \n    if pos_count > neg_count:\n        return 'Positive'\n    elif neg_count > pos_count:\n        return 'Negative'\n    return 'Neutral'\n```\n\n## Limitations\n\n- Requires Excel to be installed\n- Limited support on macOS for some features\n- Not suitable for server-side processing\n- VBA features require trust settings\n- Performance varies with Excel version\n\n## Installation\n\n```bash\npip install xlwings\n\n# For add-in functionality\nxlwings addin install\n```\n\n## Resources\n\n- [xlwings Documentation](https:\u002F\u002Fdocs.xlwings.org\u002F)\n- [GitHub Repository](https:\u002F\u002Fgithub.com\u002Fxlwings\u002Fxlwings)\n- [UDF Tutorial](https:\u002F\u002Fdocs.xlwings.org\u002Fen\u002Fstable\u002Fudfs.html)\n- [Excel VBA Reference](https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Foffice\u002Fvba\u002Fapi\u002Foverview\u002Fexcel)\n","# Excel Automation Skill\n\n## Overview\n\nThis skill enables advanced Excel automation using **xlwings** - a library that can interact with live Excel instances. Unlike openpyxl (file-only), xlwings can control Excel in real-time, execute VBA, update dashboards, and automate complex workflows.\n\n## How to Use\n\n1. Describe the Excel automation task you need\n2. Specify if you need live Excel interaction or file processing\n3. I'll generate xlwings code and execute it\n\n**Example prompts:**\n- \"Update this live Excel dashboard with new data\"\n- \"Run this VBA macro and get the results\"\n- \"Create an Excel add-in for data validation\"\n- \"Automate monthly report generation with live charts\"\n\n## Domain Knowledge\n\n### xlwings vs openpyxl\n\n| Feature | xlwings | openpyxl |\n|---------|---------|----------|\n| Requires Excel | Yes | No |\n| Live interaction | Yes | No |\n| VBA execution | Yes | No |\n| Speed (large files) | Fast | Slow |\n| Server deployment | Limited | Easy |\n\n### xlwings Fundamentals\n\n```python\nimport xlwings as xw\n\n# Connect to active Excel workbook\nwb = xw.Book.caller()  # From Excel add-in\nwb = xw.books.active   # Active workbook\n\n# Open specific file\nwb = xw.Book('path\u002Fto\u002Ffile.xlsx')\n\n# Create new workbook\nwb = xw.Book()\n\n# Get sheet\nsheet = wb.sheets['Sheet1']\nsheet = wb.sheets[0]\n```\n\n### Working with Ranges\n\n#### Reading and Writing\n```python\n# Single cell\nsheet['A1'].value = 'Hello'\nvalue = sheet['A1'].value\n\n# Range\nsheet['A1:C3'].value = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\ndata = sheet['A1:C3'].value  # Returns list of lists\n\n# Named range\nsheet['MyRange'].value = 'Named data'\n\n# Expand range (detect data boundaries)\nsheet['A1'].expand().value  # All connected data\nsheet['A1'].expand('table').value  # Table format\n```\n\n#### Dynamic Ranges\n```python\n# Current region (like Ctrl+Shift+End)\ndata = sheet['A1'].current_region.value\n\n# Used range\nused = sheet.used_range.value\n\n# Last row with data\nlast_row = sheet['A1'].end('down').row\n\n# Resize range\nrng = sheet['A1'].resize(10, 5)  # 10 rows, 5 columns\n```\n\n### Formatting\n```python\n# Font\nsheet['A1'].font.bold = True\nsheet['A1'].font.size = 14\nsheet['A1'].font.color = (255, 0, 0)  # RGB red\n\n# Fill\nsheet['A1'].color = (255, 255, 0)  # Yellow background\n\n# Number format\nsheet['B1'].number_format = '$#,##0.00'\n\n# Column width\nsheet['A:A'].column_width = 20\n\n# Row height\nsheet['1:1'].row_height = 30\n\n# Autofit\nsheet['A:D'].autofit()\n```\n\n### Excel Features\n\n#### Charts\n```python\n# Add chart\nchart = sheet.charts.add(left=100, top=100, width=400, height=250)\nchart.set_source_data(sheet['A1:B10'])\nchart.chart_type = 'column_clustered'\nchart.name = 'Sales Chart'\n\n# Modify existing chart\nchart = sheet.charts['Sales Chart']\nchart.chart_type = 'line'\n```\n\n#### Tables\n```python\n# Create Excel Table\nrng = sheet['A1'].expand()\ntable = sheet.tables.add(source=rng, name='SalesTable')\n\n# Refresh table\ntable.refresh()\n\n# Access table data\ntable_data = table.data_body_range.value\n```\n\n#### Pictures\n```python\n# Add picture\nsheet.pictures.add('logo.png', left=10, top=10, width=100, height=50)\n\n# Update picture from matplotlib\nimport matplotlib.pyplot as plt\nfig, ax = plt.subplots()\nax.plot([1, 2, 3], [1, 4, 9])\nsheet.pictures.add(fig, name='MyPlot', update=True)\n```\n\n### VBA Integration\n```python\n# Run VBA macro\nwb.macro('MacroName')()\n\n# With arguments\nwb.macro('MyMacro')('arg1', 'arg2')\n\n# Get return value\nresult = wb.macro('CalculateTotal')(100, 200)\n\n# Access VBA module\nvb_code = wb.api.VBProject.VBComponents('Module1').CodeModule.Lines(1, 10)\n```\n\n### User Defined Functions (UDFs)\n```python\n# Define a UDF (in Python file)\nimport xlwings as xw\n\n@xw.func\ndef my_sum(x, y):\n    \"\"\"Add two numbers\"\"\"\n    return x + y\n\n@xw.func\n@xw.arg('data', ndim=2)\ndef my_array_func(data):\n    \"\"\"Process array data\"\"\"\n    import numpy as np\n    return np.sum(data)\n\n# These become Excel functions: =my_sum(A1, B1)\n```\n\n### Application Control\n```python\n# Excel application settings\napp = xw.apps.active\napp.screen_updating = False  # Speed up\napp.calculation = 'manual'   # Manual calc\napp.display_alerts = False   # Suppress dialogs\n\n# Perform operations...\n\n# Restore\napp.screen_updating = True\napp.calculation = 'automatic'\napp.display_alerts = True\n```\n\n## Best Practices\n\n1. **Disable Screen Updating**: For batch operations\n2. **Use Arrays**: Read\u002Fwrite entire ranges, not cell-by-cell\n3. **Manual Calculation**: Turn off auto-calc during data loading\n4. **Close Connections**: Properly close workbooks when done\n5. **Error Handling**: Handle Excel not being installed\n\n## Common Patterns\n\n### Performance Optimization\n```python\nimport xlwings as xw\n\ndef batch_update(data, workbook_path):\n    app = xw.App(visible=False)\n    try:\n        app.screen_updating = False\n        app.calculation = 'manual'\n        \n        wb = app.books.open(workbook_path)\n        sheet = wb.sheets['Data']\n        \n        # Write all data at once\n        sheet['A1'].value = data\n        \n        app.calculation = 'automatic'\n        wb.save()\n    finally:\n        wb.close()\n        app.quit()\n```\n\n### Dashboard Update\n```python\ndef update_dashboard(data_dict):\n    wb = xw.books.active\n    \n    # Update data sheet\n    data_sheet = wb.sheets['Data']\n    for name, values in data_dict.items():\n        data_sheet[name].value = values\n    \n    # Refresh all charts\n    dashboard = wb.sheets['Dashboard']\n    for chart in dashboard.charts:\n        chart.refresh()\n    \n    # Update timestamp\n    from datetime import datetime\n    dashboard['A1'].value = f'Last Updated: {datetime.now()}'\n```\n\n### Report Generator\n```python\ndef generate_monthly_report(month, data):\n    template = xw.Book('template.xlsx')\n    \n    # Fill data\n    sheet = template.sheets['Report']\n    sheet['B2'].value = month\n    sheet['A5'].value = data\n    \n    # Run calculations\n    template.app.calculate()\n    \n    # Export to PDF\n    sheet.api.ExportAsFixedFormat(0, f'report_{month}.pdf')\n    \n    template.save(f'report_{month}.xlsx')\n```\n\n## Examples\n\n### Example 1: Live Dashboard Update\n```python\nimport xlwings as xw\nimport pandas as pd\nfrom datetime import datetime\n\n# Connect to running Excel\nwb = xw.books.active\ndashboard = wb.sheets['Dashboard']\ndata_sheet = wb.sheets['Data']\n\n# Fetch new data (simulated)\nnew_data = pd.DataFrame({\n    'Date': pd.date_range('2024-01-01', periods=30),\n    'Sales': [1000 + i*50 for i in range(30)],\n    'Costs': [600 + i*30 for i in range(30)]\n})\n\n# Update data sheet\ndata_sheet['A1'].value = new_data\n\n# Calculate profit\ndata_sheet['D1'].value = 'Profit'\ndata_sheet['D2'].value = '=B2-C2'\ndata_sheet['D2'].expand('down').value = data_sheet['D2'].formula\n\n# Update KPIs on dashboard\ndashboard['B2'].value = new_data['Sales'].sum()\ndashboard['B3'].value = new_data['Costs'].sum()\ndashboard['B4'].value = new_data['Sales'].sum() - new_data['Costs'].sum()\ndashboard['A1'].value = f'Updated: {datetime.now().strftime(\"%Y-%m-%d %H:%M\")}'\n\n# Refresh charts\nfor chart in dashboard.charts:\n    chart.api.Refresh()\n\nprint(\"Dashboard updated!\")\n```\n\n### Example 2: Batch Processing Multiple Files\n```python\nimport xlwings as xw\nfrom pathlib import Path\n\ndef process_sales_files(folder_path, output_path):\n    \"\"\"Consolidate multiple Excel files into one summary.\"\"\"\n    \n    app = xw.App(visible=False)\n    app.screen_updating = False\n    \n    try:\n        # Create summary workbook\n        summary_wb = xw.Book()\n        summary_sheet = summary_wb.sheets[0]\n        summary_sheet.name = 'Consolidated'\n        \n        headers = ['File', 'Total Sales', 'Total Units', 'Avg Price']\n        summary_sheet['A1'].value = headers\n        \n        row = 2\n        for file in Path(folder_path).glob('*.xlsx'):\n            wb = app.books.open(str(file))\n            data_sheet = wb.sheets['Sales']\n            \n            # Extract summary\n            total_sales = data_sheet['B:B'].api.SpecialCells(11).Value  # xlCellTypeConstants\n            total_units = data_sheet['C:C'].api.SpecialCells(11).Value\n            \n            # Calculate and write\n            summary_sheet[f'A{row}'].value = file.name\n            summary_sheet[f'B{row}'].value = sum(total_sales) if isinstance(total_sales, (list, tuple)) else total_sales\n            summary_sheet[f'C{row}'].value = sum(total_units) if isinstance(total_units, (list, tuple)) else total_units\n            summary_sheet[f'D{row}'].value = f'=B{row}\u002FC{row}'\n            \n            wb.close()\n            row += 1\n        \n        # Format summary\n        summary_sheet['A1:D1'].font.bold = True\n        summary_sheet['B:D'].number_format = '$#,##0.00'\n        summary_sheet['A:D'].autofit()\n        \n        summary_wb.save(output_path)\n        \n    finally:\n        app.quit()\n    \n    print(f\"Consolidated {row-2} files to {output_path}\")\n\n# Usage\nprocess_sales_files('\u002Fpath\u002Fto\u002Fsales\u002F', 'consolidated_sales.xlsx')\n```\n\n### Example 3: Excel Add-in with UDFs\n```python\n# myudfs.py - Place in xlwings project\n\nimport xlwings as xw\nimport numpy as np\n\n@xw.func\n@xw.arg('data', pd.DataFrame, index=False, header=False)\n@xw.ret(expand='table')\ndef GROWTH_RATE(data):\n    \"\"\"Calculate period-over-period growth rate\"\"\"\n    values = data.iloc[:, 0].values\n    growth = np.diff(values) \u002F values[:-1] * 100\n    return [['Growth %']] + [[g] for g in growth]\n\n@xw.func\n@xw.arg('range1', np.array, ndim=2)\n@xw.arg('range2', np.array, ndim=2)\ndef CORRELATION(range1, range2):\n    \"\"\"Calculate correlation between two ranges\"\"\"\n    return np.corrcoef(range1.flatten(), range2.flatten())[0, 1]\n\n@xw.func\ndef SENTIMENT(text):\n    \"\"\"Basic sentiment analysis (placeholder)\"\"\"\n    positive = ['good', 'great', 'excellent', 'amazing']\n    negative = ['bad', 'poor', 'terrible', 'awful']\n    \n    text_lower = text.lower()\n    pos_count = sum(word in text_lower for word in positive)\n    neg_count = sum(word in text_lower for word in negative)\n    \n    if pos_count > neg_count:\n        return 'Positive'\n    elif neg_count > pos_count:\n        return 'Negative'\n    return 'Neutral'\n```\n\n## Limitations\n\n- Requires Excel to be installed\n- Limited support on macOS for some features\n- Not suitable for server-side processing\n- VBA features require trust settings\n- Performance varies with Excel version\n\n## Installation\n\n```bash\npip install xlwings\n\n# For add-in functionality\nxlwings addin install\n```\n\n## Resources\n\n- [xlwings Documentation](https:\u002F\u002Fdocs.xlwings.org\u002F)\n- [GitHub Repository](https:\u002F\u002Fgithub.com\u002Fxlwings\u002Fxlwings)\n- [UDF Tutorial](https:\u002F\u002Fdocs.xlwings.org\u002Fen\u002Fstable\u002Fudfs.html)\n- [Excel VBA Reference](https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Foffice\u002Fvba\u002Fapi\u002Foverview\u002Fexcel)\n",{"mcp":24,"name":5,"tags":31,"author":36,"models":37,"license":15,"version":45,"category":46,"languages":47,"department":50,"description":7,"capabilities":51},{"tools":25,"server":30},[26,27,28,29],"read_xlsx","create_xlsx","apply_formula","pivot_table","office-mcp",[32,33,34,35],"excel","automation","macro","workflow","claude-office-skills",{"compatible":38,"recommended":42},[39,40,41],"claude-3-5-sonnet","gpt-4","gpt-4o",[43,44],"claude-sonnet-4","claude-opus-4","1.0","spreadsheet",[48,49],"en","zh","All",[33,52,53],"data_processing","reporting","main","8859218955d9504cd18b59e7892100718039d3b4","data\u002Fskills\u002Fclaude-office-skills-skills\u002Fexcel-automation",1,"https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper","https:\u002F\u002Fgithub.com\u002Fom-scogo","SDE-1 @ Scogo ","2026-07-18 12:22:46",{"source":8,"skillName":5,"commands":63,"prompt":73,"zipAvailable":74},[64,67,70],{"tool":65,"command":66},"npx","npx skills add om-scogo\u002Fskillsh-scraper --skill excel-automation",{"tool":68,"command":69},"bunx","bunx skills add om-scogo\u002Fskillsh-scraper --skill excel-automation",{"tool":71,"command":72},"pnpm","pnpm dlx skills add om-scogo\u002Fskillsh-scraper --skill excel-automation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fclaude-office-skills-skills\u002Fexcel-automation\u002FSkill.md",true,[76],{"path":77,"resourceType":78,"resourceTypeDesc":79,"sizeBytes":80,"sourceHtmlUrl":81},"metadata.json","REFERENCE","参考文档",485,"https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fclaude-office-skills-skills\u002Fexcel-automation\u002Fmetadata.json",[83,90,95,102,107,114],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7D6MC9FAAEV4CMNYX8W7JTG","arxiv-search","Search arXiv physics, math, and computer science preprints using natural language queries. Powered by Valyu semantic search.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002Fskills\u002Farxiv-search\u002FSKILL.md",[],[],{"skillNo":91,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7D6M85CKKN87TA98VCQV4H7","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002FSkill.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M7D4ZTCS4DR3CE4JY06X84T2","working-with-legacy-code","Safely change and test untested codebases using Feathers' \"Working Effectively with Legacy Code\". Use when the user mentions \"legacy code\", \"no tests\", \"untested codebase\", \"how do I test this\", \"seams\", \"characterization tests\", \"golden master\", \"sprout method\", \"afraid to change this code\", \"monster method\", \"dependency breaking\", or \"inherited a messy codebase\". Also trigger when changing code without tests safely, getting a class under test when constructors, statics, or singletons block it, adding features to tangled modules, or planning incremental test coverage for an old codebase. Covers the legacy-code change algorithm, seams, characterization tests, sprout\u002Fwrap, and dependency-breaking techniques. For refactoring code that already has tests, see refactoring-patterns. For day-to-day code quality, see clean-code.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002Fworking-with-legacy-code\u002FSKILL.md",[],[],{"skillNo":103,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M7D4ZHZKJD2RSNGAF63V14P4","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002FSkill.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":19},"01M7D4ZB4CJBFW5JE67CPH2QRV","web-typography","Select, pair, and implement typefaces for web projects. Use when the user mentions \"font pairing\", \"which typeface\", \"line height\", \"responsive typography\", \"web font loading\", \"type hierarchy\", \"variable fonts\", \"FOUT\u002FFOIT\", \"typographic scale\", or \"the text is hard to read\". Also trigger when choosing between system fonts and web fonts, optimizing font-loading performance, or designing readable long-form content. Covers readability evaluation, CSS implementation, and performance optimization. For overall UI design systems, see refactoring-ui. For dramatic typographic experiences, see top-design.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002Fweb-typography\u002FSKILL.md",[],[],{"skillNo":115,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":19},"01M7D4Z4MVYVY3NMJ18BNV6WNA","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002FSkill.md",[],[]]