[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6PYK75QGAKXJ52DV2JA0X5P":3,"skill-same:01M6PYK75QGAKXJ52DV2JA0X5P":84},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":59,"repositoryHtmlUrl":60,"repositoryHomepageUrl":6,"ownerHtmlUrl":61,"ownerBlogUrl":6,"ownerDescription":62,"updatedAt":63,"install":64,"resources":77},"01M6PYK75QGAKXJ52DV2JA0X5P","excel-automation",null,"Advanced Excel automation with Python using xlwings - interact with live Excel instances","Kernel8901\u002Fai-agent-skills-classification","Kernel8901","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F72647553?v=4","01M6KV388J2H5PNC8D8P940BJD","01M6KV38CS5B3AY63RKZB410YM",7,"MIT","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F工作流自动化\u002Fexcel-automation\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"automation","Excel Automation","xlsx","operations","opus","sonnet","advanced","with","live","macros","xlwings","instances","computer","execution","office","file","https","code","github","python","2026-11-10 10:12:30",false,"---\nname: excel-automation\ndescription: Advanced Excel automation with Python using xlwings - interact with live Excel instances\nauthor: claude-office-skills\nversion: \"1.0\"\ntags: [excel, automation, xlwings, macros, python]\nmodels: [claude-sonnet-4, claude-opus-4]\ntools: [computer, code_execution, file_operations]\nlibrary:\n  name: xlwings\n  url: https:\u002F\u002Fgithub.com\u002Fxlwings\u002Fxlwings\n  stars: 3.3k\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",{"name":5,"tags":43,"tools":45,"author":48,"models":49,"library":52,"version":55,"description":7},[44,18,28,27,37],"excel",[30,46,47],"code_execution","file_operations","claude-office-skills",[50,51],"claude-sonnet-4","claude-opus-4",{"url":53,"name":28,"stars":54},"https:\u002F\u002Fgithub.com\u002Fxlwings\u002Fxlwings","3.3k","1.0","main","f4cb2d49f7667e79ef7804f50396d5aaffdf1f56","工作流自动化\u002Fexcel-automation",1,"https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification","https:\u002F\u002Fgithub.com\u002FKernel8901","a little little little dobe in life but science geek","2026-04-05 16:43:56",{"source":8,"skillName":5,"commands":65,"prompt":75,"zipAvailable":76},[66,69,72],{"tool":67,"command":68},"npx","npx skills add Kernel8901\u002Fai-agent-skills-classification --skill excel-automation",{"tool":70,"command":71},"bunx","bunx skills add Kernel8901\u002Fai-agent-skills-classification --skill excel-automation",{"tool":73,"command":74},"pnpm","pnpm dlx skills add Kernel8901\u002Fai-agent-skills-classification --skill excel-automation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F工作流自动化\u002Fexcel-automation\u002FSKILL.md",true,[78],{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"_meta.json","REFERENCE","参考文档",292,"https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F工作流自动化\u002Fexcel-automation\u002F_meta.json",[85,109,132,140,147,172],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":38},"01M6Q5R6WZ06RRB9RQTW54B34B","zyfai","Earn yield on any Ethereum wallet on Base, Arbitrum, and Plasma. Use when a user wants passive DeFi yield on their funds. Deploys a non-custodial subaccount (Safe) linked to their EOA, enables automated yield optimization, and lets them deposit\u002Fwithdraw anytime.","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fzyfai-sdk\u002FSKILL.md",[],[87,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108],"safe","ethereum","defi","Optimization","user","use","Wallet","base","deposit","withdraw","yield","arbitrum","non-custodial","passive","defi yield","earn","yield optimization",{"skillNo":110,"name":111,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":38},"01M6Q5R337B5JSNER4P4YS03TN","zerion-api","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fzerion-api\u002FSKILL.md",[],[115,116,117,118,119,120,121,94,122,98,123,124,125,126,127,128,129,130,131],"api","zerion api","zerion","MCP","mcp server","server","blockchain","transactions","crypto wallet","crypto","evm","solana","query","across","positions","token","prices",{"skillNo":133,"name":134,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":38},"01M6Q5QZFYTDAZMZ27BN5VZXAR","zerion-api-skill","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fzerion-api-skill\u002FSKILL.md",[],[115,138,139,116,117,118,119,120,121,94,122,98,124,125,126,127,128,129,130,131],"api skill","zerion api skill",{"skillNo":141,"name":142,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":145,"publishedAt":38},"01M6Q5QW17QW98RA3FE45E4RD8","zerion-api-mcp","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fzerion-api-mcp\u002FSKILL.md",[],[118,115,146,116,117,119,120,94,122,98,123,124,125,126,127,128,129,130,131],"zerion api mcp",{"skillNo":148,"name":149,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":151,"categories":152,"keywords":153,"publishedAt":38},"01M6Q5QQYZB7A501BDEQWKGSJT","yahoo-finance-forex","Fetches real-time FOREX news and market data from Yahoo Finance for major currency pairs (EUR\u002FUSD, GBP\u002FUSD, USD\u002FJPY, etc.). Analyzes sentiment and provides trading context.","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fyahoo-finance-forex\u002FSKILL.md",[],[154,155,156,157,158,36,34,159,160,161,162,163,164,165,166,167,168,169,170,171],"finance","yahoo finance","forex","yahoo","yahoo finance forex","sentiment","real-time","python3","install","Market","usd","news","time","currency","gbp","pip","market data","for",{"skillNo":173,"name":174,"nameZh":6,"description":175,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":176,"categories":177,"keywords":178,"publishedAt":38},"01M6Q5QM6VS84WZVM7BKXXPF32","yahoo-finance","This skill should be used when the user asks to \"get stock prices\", \"check stock quotes\", \"look up earnings\", \"get financial data\", \"find trending stocks\", or needs stock market data from Yahoo Finance.","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fyahoo-finance-cli\u002FSKILL.md",[],[154,155,157,179,180,181,182,183,184,163,185,186,187,188,189,190,191,192,131,170],"cli","homebrew","find","check","brew","up","local","get","stock","link","trending","sf","quotes","ln"]