[{"data":1,"prerenderedAt":1536},["ShallowReactive",2],{"doc:\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-win32com-gen-py-attributeerror":3,"surround:\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-win32com-gen-py-attributeerror":1500,"ancestors:\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-win32com-gen-py-attributeerror":1509,"children:\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-win32com-gen-py-attributeerror":1514,"related:\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-win32com-gen-py-attributeerror":1515},{"id":4,"title":5,"body":6,"dateModified":1467,"datePublished":1467,"description":1468,"extension":1469,"faq":1470,"keyword":1479,"kind":1480,"meta":1481,"navigation":333,"path":1489,"seo":1490,"slug":1493,"stem":1494,"topics":1495,"type":1498,"__hash__":1499},"docs\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-win32com-gen-py-attributeerror\u002Findex.md","Fix the win32com gen_py AttributeError (CLSIDToClassMap)",{"type":7,"value":8,"toc":1455},"minimark",[9,13,24,41,46,49,72,75,79,94,110,128,304,308,311,345,356,360,370,577,580,778,789,896,900,906,973,979,986,990,993,1028,1127,1130,1222,1225,1234,1312,1315,1319,1355,1359,1381,1385,1395,1401,1407,1413,1417,1451],[10,11,12],"p",{},"A script that has driven Excel through pywin32 for months stops at the first line:",[14,15,21],"pre",{"className":16,"code":18,"language":19,"meta":20},[17],"language-text","AttributeError: module 'win32com.gen_py.00020813-0000-0000-C000-000000000046x0x1x9' has no attribute 'CLSIDToClassMap'\n","text","",[22,23,18],"code",{"__ignoreMap":20},[10,25,26,27,30,31,34,35,40],{},"Variants end in ",[22,28,29],{},"'CLSIDToPackageMap'",", or appear as \"This COM object can not automate the makepy process\". Nothing is wrong with Excel or with your code. ",[22,32,33],{},"win32com.client.gencache.EnsureDispatch"," keeps a cache of Python modules generated from Excel's type library, and one of those modules is broken: half-written because a run was interrupted, left over from a different Excel version, or written by a different Python. Deleting the broken entry fixes it; this page shows how to find it, how to do that safely in a script, and how to keep it from coming back. It is part of ",[36,37,39],"a",{"href":38},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002F","Troubleshooting Common Python Excel Errors",".",[42,43,45],"h2",{"id":44},"prerequisites","Prerequisites",[10,47,48],{},"pywin32 and Excel on Windows:",[14,50,54],{"className":51,"code":52,"language":53,"meta":20,"style":20},"language-bash shiki shiki-themes github-light github-dark-high-contrast","pip install pywin32\n","bash",[22,55,56],{"__ignoreMap":20},[57,58,61,65,69],"span",{"class":59,"line":60},"line",1,[57,62,64],{"class":63},"sMTad","pip",[57,66,68],{"class":67},"srMev"," install",[57,70,71],{"class":67}," pywin32\n",[10,73,74],{},"The code that talks to Excel only runs on Windows. The cache-cleaning function further down is plain Python and is demonstrated here against a sample folder, so its behaviour can be checked anywhere.",[42,76,78],{"id":77},"what-gen_py-is","What gen_py is",[10,80,81,84,85,89,90,93],{},[22,82,83],{},"EnsureDispatch(\"Excel.Application\")"," gives ",[86,87,88],"em",{},"early binding",": pywin32 reads Excel's type library once, generates a Python module describing every object, method and constant, and imports that module on later runs. That is what makes ",[22,91,92],{},"win32com.client.constants.xlUp"," and fast, case-correct method calls work. The generated module lives in a folder named after the type library:",[95,96,97,104],"ul",{},[98,99,100,103],"li",{},[22,101,102],{},"00020813-…-000000000046"," is the ID of Excel's type library, the long name in the error message;",[98,105,106,109],{},[22,107,108],{},"x0x1x9"," is the locale (0) and the library's version (1.9 for current Excel).",[10,111,112,113,116,117,119,120,123,124,127],{},"The folder sits inside the ",[86,114,115],{},"gen_py"," directory. Unless a ",[22,118,115],{}," folder exists inside the installed ",[22,121,122],{},"win32com"," package, pywin32 puts it in the user's temporary directory, in a subfolder per Python version, such as ",[22,125,126],{},"%LOCALAPPDATA%\\Temp\\gen_py\\3.12",". Different users, and the same user under different Python versions, each have their own cache.",[129,130,138,139,138,143,138,147,138,155,138,165,138,176,138,182,138,187,138,193,138,198,138,202,138,209,138,214,138,217,138,221,138,224,138,227,138,233,138,238,138,242,138,246,138,250,138,253,138,258,138,265,138,270,138,273,138,277,138,280,138,285,138,292,138,297,138,301],"svg",{"viewBox":131,"role":132,"ariaLabelledBy":133,"xmlns":136,"style":137},"1 0 755 142","img",[134,135],"gp-flow-t","gp-flow-d","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","width:100%;max-width:755px;height:auto;display:block;margin:1.5rem auto;font-family:Inter,ui-sans-serif,system-ui,sans-serif","\n  ",[140,141,142],"title",{"id":134},"How EnsureDispatch uses the cache",[144,145,146],"desc",{"id":135},"EnsureDispatch looks up Excel's type library ID in the cache index. If a generated module exists it imports it; if not it runs makepy to generate one. The error appears when the module exists but is incomplete, so importing it succeeds and reading CLSIDToClassMap fails.",[148,149],"rect",{"x":150,"y":151,"width":152,"height":153,"fill":154},"1","0","755","142","#ffffff",[148,156],{"x":157,"y":158,"width":159,"height":160,"rx":161,"fill":162,"stroke":163,"style":164},"20.0","16.0","115.2","110.5","12","#e7ebef","var(--line,#cdd5e6)","stroke-width:2px",[166,167,169],"g",{"transform":168},"translate(65.6,37.8) scale(1.000)",[170,171],"path",{"d":172,"fill":173,"stroke":174,"style":175},"M9 8l-4 4 4 4 M15 8l4 4-4 4","none","var(--text,#172033)","stroke-width:1.80px;stroke-linecap:round;stroke-linejoin:round",[19,177,181],{"x":178,"y":179,"style":180},"77.6","84.2","font-size:13.5px;font-weight:700;fill:var(--text,#172033);text-anchor:middle","EnsureDispatch()",[19,183,186],{"x":178,"y":184,"style":185},"103.8","font-size:11.5px;font-weight:400;fill:var(--text,#172033);text-anchor:middle","Excel.Application",[59,188],{"x1":189,"y1":190,"x2":191,"y2":190,"stroke":192,"style":164},"140.2","71.2","162.2","var(--brand,#5b5cf0)",[194,195],"polygon",{"points":196,"fill":197},"166.2,71.2 157.2,76.2 157.2,66.2","#5b5cf0",[148,199],{"x":200,"y":158,"width":159,"height":160,"rx":161,"fill":201,"stroke":192,"style":164},"171.2","#f0f4ff",[166,203,205],{"transform":204},"translate(216.8,37.8) scale(1.000)",[170,206],{"d":207,"fill":173,"stroke":208,"style":175},"M11 4a7 7 0 1 0 .01 0z M16 16l5 5","var(--brand-strong,#4338ca)",[19,210,213],{"x":211,"y":179,"style":212},"228.8","font-size:13.5px;font-weight:700;fill:var(--brand-strong,#4338ca);text-anchor:middle","Cache index",[19,215,216],{"x":211,"y":184,"style":185},"dicts.dat",[59,218],{"x1":219,"y1":190,"x2":220,"y2":190,"stroke":192,"style":164},"291.4","313.4",[194,222],{"points":223,"fill":197},"317.4,71.2 308.4,76.2 308.4,66.2",[148,225],{"x":226,"y":158,"width":159,"height":160,"rx":161,"fill":201,"stroke":192,"style":164},"322.4",[166,228,230],{"transform":229},"translate(368.0,29.0) scale(1.000)",[170,231],{"d":232,"fill":173,"stroke":208,"style":175},"M6 3h9l4 4v14H6z M15 3v4h4",[19,234,237],{"x":235,"y":236,"style":212},"380.0","75.5","Generated",[19,239,241],{"x":235,"y":240,"style":212},"93.0","module",[19,243,245],{"x":235,"y":244,"style":185},"112.5","00020813-…x0x1x9",[59,247],{"x1":248,"y1":190,"x2":249,"y2":190,"stroke":192,"style":164},"442.6","464.6",[194,251],{"points":252,"fill":197},"468.6,71.2 459.6,76.2 459.6,66.2",[148,254],{"x":255,"y":158,"width":159,"height":160,"rx":161,"fill":256,"stroke":257,"style":164},"473.6","#d9f4f1","var(--teal,#0f9488)",[166,259,261],{"transform":260},"translate(519.2,37.8) scale(1.000)",[170,262],{"d":263,"fill":173,"stroke":264,"style":175},"M12 3c-4 0-4 1.6-4 3v2h4.2v1H6c-2 0-3 1.4-3 4s1 4 3 4h2v-2.6c0-1.6 1.3-2.9 2.9-2.9h4.2c1.3 0 2.4-1.1 2.4-2.4V6c0-1.6-1.8-3-5.5-3z M10 5.5h.01 M12 21c4 0 4-1.6 4-3v-2h-4.2v-1H18c2 0 3-1.4 3-4s-1-4-3-4h-2v2.6c0 1.6-1.3 2.9-2.9 2.9H8.9c-1.3 0-2.4 1.1-2.4 2.4V18c0 1.6 1.8 3 5.5 3z M14 18.5h.01","var(--teal-ink,#0b6157)",[19,266,269],{"x":267,"y":179,"style":268},"531.2","font-size:13.5px;font-weight:700;fill:var(--teal-ink,#0b6157);text-anchor:middle","Import",[19,271,272],{"x":267,"y":184,"style":185},"module loads",[59,274],{"x1":275,"y1":190,"x2":276,"y2":190,"stroke":192,"style":164},"593.8","615.8",[194,278],{"points":279,"fill":197},"619.8,71.2 610.8,76.2 610.8,66.2",[148,281],{"x":282,"y":158,"width":159,"height":160,"rx":161,"fill":283,"stroke":284,"style":164},"624.8","#fce9e9","var(--danger,#dc2626)",[166,286,288],{"transform":287},"translate(670.4,29.0) scale(1.000)",[170,289],{"d":290,"fill":173,"stroke":291,"style":175},"M12 3.5l9.5 17h-19z M12 10v5 M12 17.8v.4","var(--accent-ink,#be185d)",[19,293,296],{"x":294,"y":236,"style":295},"682.4","font-size:13.5px;font-weight:700;fill:var(--accent-ink,#be185d);text-anchor:middle","Class map",[19,298,300],{"x":294,"y":299,"style":185},"95.0","missing if",[19,302,303],{"x":294,"y":244,"style":185},"broken",[42,305,307],{"id":306},"step-1-find-the-cache-folder","Step 1 — Find the cache folder",[10,309,310],{},"Ask pywin32 where it keeps the cache rather than guessing; it prints the path it will use:",[14,312,316],{"className":313,"code":314,"language":315,"meta":20,"style":20},"language-python shiki shiki-themes github-light github-dark-high-contrast","import win32com\n\nprint(win32com.__gen_path__)\n","python",[22,317,318,328,335],{"__ignoreMap":20},[57,319,320,324],{"class":59,"line":60},[57,321,323],{"class":322},"s-kum","import",[57,325,327],{"class":326},"skGVy"," win32com\n",[57,329,331],{"class":59,"line":330},2,[57,332,334],{"emptyLinePlaceholder":333},true,"\n",[57,336,338,342],{"class":59,"line":337},3,[57,339,341],{"class":340},"sP0c6","print",[57,343,344],{"class":326},"(win32com.__gen_path__)\n",[10,346,347,348,351,352,355],{},"Run it with the same interpreter the failing script uses: the path includes the Python version, and a scheduled job running under a service account has its own temporary directory, so its cache is somewhere else entirely. On the command line, ",[22,349,350],{},"python -m win32com.client.gencache -d"," lists the cached type libraries, and it fails with the same ",[22,353,354],{},"AttributeError"," when the Excel entry is the broken one, which confirms the diagnosis.",[42,357,359],{"id":358},"step-2-delete-the-excel-entry-not-everything","Step 2 — Delete the Excel entry, not everything",[10,361,362,363,366,367,369],{},"The cache holds entries for every COM library used on the machine, Outlook and Word included. Removing only the Excel entry is enough, and leaves the others alone. The entry can be a folder (for large libraries such as Excel) or a single ",[22,364,365],{},".py"," file, and the index file ",[22,368,216],{}," should be removed with it so pywin32 does not look for the deleted entry:",[14,371,373],{"className":313,"code":372,"language":315,"meta":20,"style":20},"import shutil\nfrom pathlib import Path\n\nEXCEL_TYPELIB = \"00020813-0000-0000-C000-000000000046\"\n\ndef clear_excel_cache(gen_path):\n    \"\"\"Remove generated Excel wrappers and the cache index from a gen_py folder.\"\"\"\n    gen = Path(gen_path)\n    removed = []\n    for entry in gen.glob(f\"{EXCEL_TYPELIB}x*\"):\n        if entry.is_dir():\n            shutil.rmtree(entry)\n        else:\n            entry.unlink()\n        removed.append(entry.name)\n    index = gen \u002F \"dicts.dat\"\n    if index.exists():\n        index.unlink()\n        removed.append(index.name)\n    return removed\n",[22,374,375,382,395,399,411,416,429,435,447,458,494,503,509,518,524,530,547,556,562,568],{"__ignoreMap":20},[57,376,377,379],{"class":59,"line":60},[57,378,323],{"class":322},[57,380,381],{"class":326}," shutil\n",[57,383,384,387,390,392],{"class":59,"line":330},[57,385,386],{"class":322},"from",[57,388,389],{"class":326}," pathlib ",[57,391,323],{"class":322},[57,393,394],{"class":326}," Path\n",[57,396,397],{"class":59,"line":337},[57,398,334],{"emptyLinePlaceholder":333},[57,400,402,405,408],{"class":59,"line":401},4,[57,403,404],{"class":340},"EXCEL_TYPELIB",[57,406,407],{"class":322}," =",[57,409,410],{"class":67}," \"00020813-0000-0000-C000-000000000046\"\n",[57,412,414],{"class":59,"line":413},5,[57,415,334],{"emptyLinePlaceholder":333},[57,417,419,422,426],{"class":59,"line":418},6,[57,420,421],{"class":322},"def",[57,423,425],{"class":424},"s_Opv"," clear_excel_cache",[57,427,428],{"class":326},"(gen_path):\n",[57,430,432],{"class":59,"line":431},7,[57,433,434],{"class":67},"    \"\"\"Remove generated Excel wrappers and the cache index from a gen_py folder.\"\"\"\n",[57,436,438,441,444],{"class":59,"line":437},8,[57,439,440],{"class":326},"    gen ",[57,442,443],{"class":322},"=",[57,445,446],{"class":326}," Path(gen_path)\n",[57,448,450,453,455],{"class":59,"line":449},9,[57,451,452],{"class":326},"    removed ",[57,454,443],{"class":322},[57,456,457],{"class":326}," []\n",[57,459,461,464,467,470,473,476,479,483,485,488,491],{"class":59,"line":460},10,[57,462,463],{"class":322},"    for",[57,465,466],{"class":326}," entry ",[57,468,469],{"class":322},"in",[57,471,472],{"class":326}," gen.glob(",[57,474,475],{"class":322},"f",[57,477,478],{"class":67},"\"",[57,480,482],{"class":481},"sSjpA","{",[57,484,404],{"class":340},[57,486,487],{"class":481},"}",[57,489,490],{"class":67},"x*\"",[57,492,493],{"class":326},"):\n",[57,495,497,500],{"class":59,"line":496},11,[57,498,499],{"class":322},"        if",[57,501,502],{"class":326}," entry.is_dir():\n",[57,504,506],{"class":59,"line":505},12,[57,507,508],{"class":326},"            shutil.rmtree(entry)\n",[57,510,512,515],{"class":59,"line":511},13,[57,513,514],{"class":322},"        else",[57,516,517],{"class":326},":\n",[57,519,521],{"class":59,"line":520},14,[57,522,523],{"class":326},"            entry.unlink()\n",[57,525,527],{"class":59,"line":526},15,[57,528,529],{"class":326},"        removed.append(entry.name)\n",[57,531,533,536,538,541,544],{"class":59,"line":532},16,[57,534,535],{"class":326},"    index ",[57,537,443],{"class":322},[57,539,540],{"class":326}," gen ",[57,542,543],{"class":322},"\u002F",[57,545,546],{"class":67}," \"dicts.dat\"\n",[57,548,550,553],{"class":59,"line":549},17,[57,551,552],{"class":322},"    if",[57,554,555],{"class":326}," index.exists():\n",[57,557,559],{"class":59,"line":558},18,[57,560,561],{"class":326},"        index.unlink()\n",[57,563,565],{"class":59,"line":564},19,[57,566,567],{"class":326},"        removed.append(index.name)\n",[57,569,571,574],{"class":59,"line":570},20,[57,572,573],{"class":322},"    return",[57,575,576],{"class":326}," removed\n",[10,578,579],{},"Here it runs against a sample cache laid out the way pywin32 lays it out, with Excel's broken folder, an Outlook entry and the index:",[14,581,583],{"className":313,"code":582,"language":315,"meta":20,"style":20},"sample = Path(\"gen_py\u002F3.12\")\n(sample \u002F f\"{EXCEL_TYPELIB}x0x1x9\").mkdir(parents=True, exist_ok=True)\n(sample \u002F f\"{EXCEL_TYPELIB}x0x1x9\" \u002F \"__init__.py\").write_text(\"\")       # the truncated module\n(sample \u002F \"00062FFF-0000-0000-C000-000000000046x0x9x6.py\").write_text(\"# Outlook\")\n(sample \u002F \"dicts.dat\").write_bytes(b\"index\")\n(sample \u002F \"__init__.py\").write_text(\"\")\n\nprint(\"removed:\", clear_excel_cache(sample))\nprint(\"left:\", sorted(p.name for p in sample.iterdir()))\n",[22,584,585,601,646,683,699,719,733,737,750],{"__ignoreMap":20},[57,586,587,590,592,595,598],{"class":59,"line":60},[57,588,589],{"class":326},"sample ",[57,591,443],{"class":322},[57,593,594],{"class":326}," Path(",[57,596,597],{"class":67},"\"gen_py\u002F3.12\"",[57,599,600],{"class":326},")\n",[57,602,603,606,608,611,613,615,617,619,622,625,629,631,634,637,640,642,644],{"class":59,"line":330},[57,604,605],{"class":326},"(sample ",[57,607,543],{"class":322},[57,609,610],{"class":322}," f",[57,612,478],{"class":67},[57,614,482],{"class":481},[57,616,404],{"class":340},[57,618,487],{"class":481},[57,620,621],{"class":67},"x0x1x9\"",[57,623,624],{"class":326},").mkdir(",[57,626,628],{"class":627},"sa561","parents",[57,630,443],{"class":322},[57,632,633],{"class":340},"True",[57,635,636],{"class":326},", ",[57,638,639],{"class":627},"exist_ok",[57,641,443],{"class":322},[57,643,633],{"class":340},[57,645,600],{"class":326},[57,647,648,650,652,654,656,658,660,662,664,667,670,673,676,679],{"class":59,"line":337},[57,649,605],{"class":326},[57,651,543],{"class":322},[57,653,610],{"class":322},[57,655,478],{"class":67},[57,657,482],{"class":481},[57,659,404],{"class":340},[57,661,487],{"class":481},[57,663,621],{"class":67},[57,665,666],{"class":322}," \u002F",[57,668,669],{"class":67}," \"__init__.py\"",[57,671,672],{"class":326},").write_text(",[57,674,675],{"class":67},"\"\"",[57,677,678],{"class":326},")       ",[57,680,682],{"class":681},"s-wDw","# the truncated module\n",[57,684,685,687,689,692,694,697],{"class":59,"line":401},[57,686,605],{"class":326},[57,688,543],{"class":322},[57,690,691],{"class":67}," \"00062FFF-0000-0000-C000-000000000046x0x9x6.py\"",[57,693,672],{"class":326},[57,695,696],{"class":67},"\"# Outlook\"",[57,698,600],{"class":326},[57,700,701,703,705,708,711,714,717],{"class":59,"line":413},[57,702,605],{"class":326},[57,704,543],{"class":322},[57,706,707],{"class":67}," \"dicts.dat\"",[57,709,710],{"class":326},").write_bytes(",[57,712,713],{"class":322},"b",[57,715,716],{"class":67},"\"index\"",[57,718,600],{"class":326},[57,720,721,723,725,727,729,731],{"class":59,"line":418},[57,722,605],{"class":326},[57,724,543],{"class":322},[57,726,669],{"class":67},[57,728,672],{"class":326},[57,730,675],{"class":67},[57,732,600],{"class":326},[57,734,735],{"class":59,"line":431},[57,736,334],{"emptyLinePlaceholder":333},[57,738,739,741,744,747],{"class":59,"line":437},[57,740,341],{"class":340},[57,742,743],{"class":326},"(",[57,745,746],{"class":67},"\"removed:\"",[57,748,749],{"class":326},", clear_excel_cache(sample))\n",[57,751,752,754,756,759,761,764,767,770,773,775],{"class":59,"line":449},[57,753,341],{"class":340},[57,755,743],{"class":326},[57,757,758],{"class":67},"\"left:\"",[57,760,636],{"class":326},[57,762,763],{"class":340},"sorted",[57,765,766],{"class":326},"(p.name ",[57,768,769],{"class":322},"for",[57,771,772],{"class":326}," p ",[57,774,469],{"class":322},[57,776,777],{"class":326}," sample.iterdir()))\n",[10,779,780,781,784,785,788],{},"On Windows, call it with ",[22,782,783],{},"win32com.__gen_path__",", with no Excel automation running in the meantime, then run the script again. ",[22,786,787],{},"EnsureDispatch"," regenerates the module on first use, which takes a few seconds once.",[129,790,138,796,138,799,138,802,138,807,138,813,138,819,138,823,138,827,138,831,138,835,138,839,138,844,138,846,138,850,138,852,138,855,138,858,138,862,138,864,138,867,138,869,138,872,138,875,138,877,138,879,138,881,138,883,138,886,138,890,138,892,138,894],{"viewBox":791,"role":132,"ariaLabelledBy":792,"xmlns":136,"style":795},"159 0 442 172",[793,794],"gp-folder-t","gp-folder-d","width:100%;max-width:442px;height:auto;display:block;margin:1.5rem auto;font-family:Inter,ui-sans-serif,system-ui,sans-serif",[140,797,798],{"id":793},"The gen_py folder before and after",[144,800,801],{"id":794},"A table of the entries in the gen_py folder. The Excel entry and dicts.dat are removed; the Outlook entry and __init__.py stay. On the next EnsureDispatch call the Excel entry and the index are rebuilt.",[148,803],{"x":804,"y":151,"width":805,"height":806,"fill":154},"159","442","172",[148,808],{"x":809,"y":158,"width":810,"height":811,"rx":151,"fill":201,"stroke":192,"style":812},"175.1","216.2","28.0","stroke-width:1.5px",[19,814,818],{"x":815,"y":816,"style":817},"283.2","35.0","font-size:11px;font-weight:700;fill:var(--brand-strong,#4338ca);text-anchor:middle","Entry",[148,820],{"x":821,"y":158,"width":822,"height":811,"rx":151,"fill":201,"stroke":192,"style":812},"391.2","66.6",[19,824,826],{"x":825,"y":816,"style":817},"424.5","Action",[148,828],{"x":829,"y":158,"width":830,"height":811,"rx":151,"fill":201,"stroke":192,"style":812},"457.8","127.1",[19,832,834],{"x":833,"y":816,"style":817},"521.4","Next run",[148,836],{"x":809,"y":837,"width":810,"height":811,"rx":151,"fill":154,"stroke":163,"style":838},"44.0","stroke-width:1px",[19,840,843],{"x":815,"y":841,"style":842},"63.0","font-size:11px;font-weight:400;fill:var(--text,#172033);text-anchor:middle","00020813-…x0x1x9 (Excel)",[148,845],{"x":821,"y":837,"width":822,"height":811,"rx":151,"fill":283,"stroke":284,"style":812},[19,847,849],{"x":825,"y":841,"style":848},"font-size:11px;font-weight:700;fill:var(--accent-ink,#be185d);text-anchor:middle","deleted",[148,851],{"x":829,"y":837,"width":830,"height":811,"rx":151,"fill":154,"stroke":163,"style":838},[19,853,854],{"x":833,"y":841,"style":842},"rebuilt on next run",[148,856],{"x":809,"y":857,"width":810,"height":811,"rx":151,"fill":154,"stroke":163,"style":838},"72.0",[19,859,861],{"x":815,"y":860,"style":842},"91.0","00062FFF-…x0x9x6.py (Outlook)",[148,863],{"x":821,"y":857,"width":822,"height":811,"rx":151,"fill":154,"stroke":163,"style":838},[19,865,866],{"x":825,"y":860,"style":842},"kept",[148,868],{"x":829,"y":857,"width":830,"height":811,"rx":151,"fill":154,"stroke":163,"style":838},[148,870],{"x":809,"y":871,"width":810,"height":811,"rx":151,"fill":154,"stroke":163,"style":838},"100.0",[19,873,216],{"x":815,"y":874,"style":842},"119.0",[148,876],{"x":821,"y":871,"width":822,"height":811,"rx":151,"fill":283,"stroke":284,"style":812},[19,878,849],{"x":825,"y":874,"style":848},[148,880],{"x":829,"y":871,"width":830,"height":811,"rx":151,"fill":154,"stroke":163,"style":838},[19,882,854],{"x":833,"y":874,"style":842},[148,884],{"x":809,"y":885,"width":810,"height":811,"rx":151,"fill":154,"stroke":163,"style":838},"128.0",[19,887,889],{"x":815,"y":888,"style":842},"147.0","__init__.py",[148,891],{"x":821,"y":885,"width":822,"height":811,"rx":151,"fill":154,"stroke":163,"style":838},[19,893,866],{"x":825,"y":888,"style":842},[148,895],{"x":829,"y":885,"width":830,"height":811,"rx":151,"fill":154,"stroke":163,"style":838},[42,897,899],{"id":898},"step-3-rebuild-and-verify","Step 3 — Rebuild and verify",[10,901,902,903,905],{},"With the entry gone, the next ",[22,904,787],{}," regenerates it. A short check confirms early binding works again, because constants are only available with a generated module:",[14,907,909],{"className":313,"code":908,"language":315,"meta":20,"style":20},"import win32com.client as win32\n\nexcel = win32.gencache.EnsureDispatch(\"Excel.Application\")\nprint(type(excel))                                  # \u003Cclass 'win32com.gen_py....Application'>\nprint(win32.constants.xlUp)                         # -4162, from the regenerated module\nexcel.Quit()\n",[22,910,911,924,928,943,958,968],{"__ignoreMap":20},[57,912,913,915,918,921],{"class":59,"line":60},[57,914,323],{"class":322},[57,916,917],{"class":326}," win32com.client ",[57,919,920],{"class":322},"as",[57,922,923],{"class":326}," win32\n",[57,925,926],{"class":59,"line":330},[57,927,334],{"emptyLinePlaceholder":333},[57,929,930,933,935,938,941],{"class":59,"line":337},[57,931,932],{"class":326},"excel ",[57,934,443],{"class":322},[57,936,937],{"class":326}," win32.gencache.EnsureDispatch(",[57,939,940],{"class":67},"\"Excel.Application\"",[57,942,600],{"class":326},[57,944,945,947,949,952,955],{"class":59,"line":401},[57,946,341],{"class":340},[57,948,743],{"class":326},[57,950,951],{"class":340},"type",[57,953,954],{"class":326},"(excel))                                  ",[57,956,957],{"class":681},"# \u003Cclass 'win32com.gen_py....Application'>\n",[57,959,960,962,965],{"class":59,"line":413},[57,961,341],{"class":340},[57,963,964],{"class":326},"(win32.constants.xlUp)                         ",[57,966,967],{"class":681},"# -4162, from the regenerated module\n",[57,969,970],{"class":59,"line":418},[57,971,972],{"class":326},"excel.Quit()\n",[10,974,975,976,978],{},"The regenerated folder appears under the same name as the one you deleted, and ",[22,977,216],{}," is written again next to it. If the error returns immediately, the new module is being generated by a Python other than the one you checked, or another process is still holding the old module in memory; close every Python process that talks to Excel and try again.",[10,980,981,982,985],{},"If a script only needs to get running and does not use constants, ",[22,983,984],{},"win32com.client.dynamic.Dispatch(\"Excel.Application\")"," uses late binding and never touches the cache. It is slower per call and method names are resolved at run time, so it is a workaround, not the fix.",[42,987,989],{"id":988},"why-it-breaks-and-how-to-prevent-it","Why it breaks, and how to prevent it",[10,991,992],{},"The common causes, in the order they turn up:",[95,994,995,1002,1008,1017],{},[98,996,997,1001],{},[998,999,1000],"strong",{},"An interrupted first run."," Generation takes a few seconds; a script killed during it, or two scripts starting at once, leaves a partial module. Warm the cache once, interactively, after installing Python or pywin32.",[98,1003,1004,1007],{},[998,1005,1006],{},"Excel updates."," A new Excel version can change the type library version, and a cache built against the old one no longer matches. Clearing it after major Office updates avoids surprises.",[98,1009,1010,1013,1014,1016],{},[998,1011,1012],{},"Several Python installations."," Each Python version writes its own subfolder, but a copied virtual environment or a ",[22,1015,115],{}," folder inside a packaged application can carry a cache from another machine. Delete it from the package.",[98,1018,1019,1022,1023,1027],{},[998,1020,1021],{},"Shared service accounts."," Scheduled jobs running as one account share one cache; a job that crashes mid-generation breaks the others. ",[36,1024,1026],{"href":1025},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-com-and-pywin32\u002Frun-excel-com-automation-from-task-scheduler\u002F","Run Excel COM Automation from Task Scheduler"," covers running these jobs reliably.",[129,1029,138,1035,138,1038,138,1041,138,1046,138,1051,138,1058,138,1064,138,1068,138,1073,138,1077,138,1082,138,1089,138,1093,138,1097,138,1100,138,1103,138,1106,138,1112,138,1117,138,1121,138,1124],{"viewBox":1030,"role":132,"ariaLabelledBy":1031,"xmlns":136,"style":1034},"4 0 752 181",[1032,1033],"gp-causes-t","gp-causes-d","width:100%;max-width:752px;height:auto;display:block;margin:1.5rem auto;font-family:Inter,ui-sans-serif,system-ui,sans-serif",[140,1036,1037],{"id":1032},"Where broken caches come from",[144,1039,1040],{"id":1033},"Three panels. Interrupted generation leaves a partial module, so warm the cache once and avoid concurrent first runs. Office updates change the type library, so clear the Excel entry after upgrades. Copied environments and packaged apps carry someone else's cache, so exclude gen_py when copying or freezing.",[148,1042],{"x":1043,"y":151,"width":1044,"height":1045,"fill":154},"4","752","181",[148,1047],{"x":157,"y":158,"width":1048,"height":1049,"rx":1050,"fill":283,"stroke":284,"style":164},"228.0","149.0","14",[166,1052,1054],{"transform":1053},"translate(121.0,29.0) scale(1.083)",[170,1055],{"d":1056,"fill":173,"stroke":291,"style":1057},"M13 2L4 14h7l-1 8 9-12h-7z M3 3l18 18","stroke-width:1.66px;stroke-linecap:round;stroke-linejoin:round",[19,1059,1063],{"x":1060,"y":1061,"style":1062},"134.0","78.0","font-size:14px;font-weight:700;fill:var(--accent-ink,#be185d);text-anchor:middle","Interrupted generation",[59,1065],{"x1":1066,"y1":860,"x2":1067,"y2":860,"stroke":284,"style":838},"36.0","232.0",[19,1069,1072],{"x":1060,"y":1070,"style":1071},"111.0","font-size:12px;font-weight:400;fill:var(--text,#172033);text-anchor:middle","killed or concurrent first run",[19,1074,1076],{"x":1060,"y":1075,"style":1071},"137.0","warm the cache once",[148,1078],{"x":1079,"y":158,"width":1048,"height":1049,"rx":1050,"fill":1080,"stroke":1081,"style":164},"266.0","#fdefd8","var(--gold,#b4740a)",[166,1083,1085],{"transform":1084},"translate(367.0,29.0) scale(1.083)",[170,1086],{"d":1087,"fill":173,"stroke":1088,"style":1057},"M20 11a8 8 0 1 0-2.3 5.7 M20 4v7h-7","var(--gold-ink,#7a4e06)",[19,1090,1092],{"x":235,"y":1061,"style":1091},"font-size:14px;font-weight:700;fill:var(--gold-ink,#7a4e06);text-anchor:middle","Office update",[59,1094],{"x1":1095,"y1":860,"x2":1096,"y2":860,"stroke":1081,"style":838},"282.0","478.0",[19,1098,1099],{"x":235,"y":1070,"style":1071},"type library changed",[19,1101,1102],{"x":235,"y":1075,"style":1071},"clear after upgrades",[148,1104],{"x":1105,"y":158,"width":1048,"height":1049,"rx":1050,"fill":201,"stroke":192,"style":164},"512.0",[166,1107,1109],{"transform":1108},"translate(613.0,29.0) scale(1.083)",[170,1110],{"d":1111,"fill":173,"stroke":208,"style":1057},"M12 2.5l8.5 4.7v9.6L12 21.5l-8.5-4.7V7.2z M3.5 7.2l8.5 4.7 8.5-4.7 M12 11.9v9.6",[19,1113,1116],{"x":1114,"y":1061,"style":1115},"626.0","font-size:14px;font-weight:700;fill:var(--brand-strong,#4338ca);text-anchor:middle","Copied environments",[59,1118],{"x1":1119,"y1":860,"x2":1120,"y2":860,"stroke":192,"style":838},"528.0","724.0",[19,1122,1123],{"x":1114,"y":1070,"style":1071},"cache from another machine",[19,1125,1126],{"x":1114,"y":1075,"style":1071},"exclude gen_py",[10,1128,1129],{},"When a job fails on a server and works on your laptop, the first question is which Python and which cache the job actually uses. Log both at the start of every run; it costs nothing and answers the question from the job's own output:",[14,1131,1133],{"className":313,"code":1132,"language":315,"meta":20,"style":20},"import logging\nimport sys\nfrom importlib.metadata import version\nimport win32com\n\nlogging.info(\"python %s at %s\", sys.version.split()[0], sys.executable)\nlogging.info(\"pywin32 %s, gen_py cache at %s\", version(\"pywin32\"), win32com.__gen_path__)\n",[22,1134,1135,1142,1149,1161,1167,1171,1197],{"__ignoreMap":20},[57,1136,1137,1139],{"class":59,"line":60},[57,1138,323],{"class":322},[57,1140,1141],{"class":326}," logging\n",[57,1143,1144,1146],{"class":59,"line":330},[57,1145,323],{"class":322},[57,1147,1148],{"class":326}," sys\n",[57,1150,1151,1153,1156,1158],{"class":59,"line":337},[57,1152,386],{"class":322},[57,1154,1155],{"class":326}," importlib.metadata ",[57,1157,323],{"class":322},[57,1159,1160],{"class":326}," version\n",[57,1162,1163,1165],{"class":59,"line":401},[57,1164,323],{"class":322},[57,1166,327],{"class":326},[57,1168,1169],{"class":59,"line":413},[57,1170,334],{"emptyLinePlaceholder":333},[57,1172,1173,1176,1179,1182,1185,1187,1189,1192,1194],{"class":59,"line":418},[57,1174,1175],{"class":326},"logging.info(",[57,1177,1178],{"class":67},"\"python ",[57,1180,1181],{"class":481},"%s",[57,1183,1184],{"class":67}," at ",[57,1186,1181],{"class":481},[57,1188,478],{"class":67},[57,1190,1191],{"class":326},", sys.version.split()[",[57,1193,151],{"class":340},[57,1195,1196],{"class":326},"], sys.executable)\n",[57,1198,1199,1201,1204,1206,1209,1211,1213,1216,1219],{"class":59,"line":431},[57,1200,1175],{"class":326},[57,1202,1203],{"class":67},"\"pywin32 ",[57,1205,1181],{"class":481},[57,1207,1208],{"class":67},", gen_py cache at ",[57,1210,1181],{"class":481},[57,1212,478],{"class":67},[57,1214,1215],{"class":326},", version(",[57,1217,1218],{"class":67},"\"pywin32\"",[57,1220,1221],{"class":326},"), win32com.__gen_path__)\n",[10,1223,1224],{},"Two jobs that print different cache paths do not share a cache, so clearing one does not fix the other. A service account's temporary directory is also not the one you see when logged in, which is why clearing \"the\" gen_py folder by hand sometimes appears to do nothing.",[10,1226,1227,1228,1230,1231,1233],{},"A scheduled job can recover by itself: catch the ",[22,1229,354],{}," from ",[22,1232,787],{},", clear the Excel entry, and try once more:",[14,1235,1237],{"className":313,"code":1236,"language":315,"meta":20,"style":20},"import win32com\nimport win32com.client as win32\n\ndef excel_app():\n    try:\n        return win32.gencache.EnsureDispatch(\"Excel.Application\")\n    except AttributeError:\n        clear_excel_cache(win32com.__gen_path__)\n        return win32.gencache.EnsureDispatch(\"Excel.Application\")\n",[22,1238,1239,1245,1255,1259,1269,1276,1287,1297,1302],{"__ignoreMap":20},[57,1240,1241,1243],{"class":59,"line":60},[57,1242,323],{"class":322},[57,1244,327],{"class":326},[57,1246,1247,1249,1251,1253],{"class":59,"line":330},[57,1248,323],{"class":322},[57,1250,917],{"class":326},[57,1252,920],{"class":322},[57,1254,923],{"class":326},[57,1256,1257],{"class":59,"line":337},[57,1258,334],{"emptyLinePlaceholder":333},[57,1260,1261,1263,1266],{"class":59,"line":401},[57,1262,421],{"class":322},[57,1264,1265],{"class":424}," excel_app",[57,1267,1268],{"class":326},"():\n",[57,1270,1271,1274],{"class":59,"line":413},[57,1272,1273],{"class":322},"    try",[57,1275,517],{"class":326},[57,1277,1278,1281,1283,1285],{"class":59,"line":418},[57,1279,1280],{"class":322},"        return",[57,1282,937],{"class":326},[57,1284,940],{"class":67},[57,1286,600],{"class":326},[57,1288,1289,1292,1295],{"class":59,"line":431},[57,1290,1291],{"class":322},"    except",[57,1293,1294],{"class":340}," AttributeError",[57,1296,517],{"class":326},[57,1298,1299],{"class":59,"line":437},[57,1300,1301],{"class":326},"        clear_excel_cache(win32com.__gen_path__)\n",[57,1303,1304,1306,1308,1310],{"class":59,"line":449},[57,1305,1280],{"class":322},[57,1307,937],{"class":326},[57,1309,940],{"class":67},[57,1311,600],{"class":326},[10,1313,1314],{},"The retry has to happen in a fresh process if the broken module was already imported; if the second attempt still fails, exit with an error and let the scheduler rerun the job.",[42,1316,1318],{"id":1317},"common-pitfalls","Common pitfalls",[95,1320,1321,1327,1336,1346],{},[98,1322,1323,1326],{},[998,1324,1325],{},"Deleting all of gen_py while Excel scripts run."," Clear it between runs; a script generating a module while another deletes the folder recreates the problem.",[98,1328,1329,1332,1333,1335],{},[998,1330,1331],{},"Clearing the wrong cache."," ",[22,1334,783],{}," depends on the Python that runs it; check it with the same interpreter the job uses.",[98,1337,1338,1345],{},[998,1339,1340,1341,1344],{},"Reaching for ",[22,1342,1343],{},"dynamic.Dispatch"," permanently."," It avoids the cache but also loses constants and early binding; fix the cache instead.",[98,1347,1348,1351,1352,1354],{},[998,1349,1350],{},"Packaging the cache."," Tools that freeze a Python app can include a ",[22,1353,115],{}," folder built on the developer's machine; exclude it.",[42,1356,1358],{"id":1357},"conclusion","Conclusion",[10,1360,1361,1362,1332,1365,1367,1368,1370,1371,1374,1375,1377,1378,1380],{},"The ",[22,1363,1364],{},"CLSIDToClassMap",[22,1366,354],{}," means pywin32's generated module for Excel's type library is incomplete or stale. Find the cache with ",[22,1369,783],{},", delete the entries starting with Excel's type-library ID, ",[22,1372,1373],{},"00020813-…",", together with ",[22,1376,216],{},", and let ",[22,1379,787],{}," rebuild them on the next run. Warm the cache once after installs and Office updates, avoid concurrent first runs, and let scheduled jobs clear the entry and retry.",[42,1382,1384],{"id":1383},"frequently-asked-questions","Frequently asked questions",[10,1386,1387,1390,1391,1394],{},[998,1388,1389],{},"Where is the win32com gen_py folder?","\nPrint win32com.",[998,1392,1393],{},"gen_path",". By default it is a gen_py folder inside the user's temporary directory, with a subfolder per Python version, unless a gen_py folder exists inside the installed win32com package.",[10,1396,1397,1400],{},[998,1398,1399],{},"Is it safe to delete the gen_py folder?","\nYes. It only holds generated wrappers, which pywin32 recreates on demand. Deleting only the Excel entry and dicts.dat is enough and leaves wrappers for other applications in place.",[10,1402,1403,1406],{},[998,1404,1405],{},"What does the folder name 00020813-…x0x1x9 mean?","\nIt is the ID of Excel's type library followed by the locale and version of the library. The generated Python module for Excel is stored under that name.",[10,1408,1409,1412],{},[998,1410,1411],{},"Should I use Dispatch instead of EnsureDispatch to avoid the error?","\ndynamic.Dispatch avoids the cache but loses constants and early binding. Use it as a temporary workaround and clear the cache to fix the real problem.",[42,1414,1416],{"id":1415},"related","Related",[95,1418,1419,1425,1432,1439,1446],{},[98,1420,1421,1422,1424],{},"Up one level: ",[36,1423,39],{"href":38}," — the other common errors.",[98,1426,1427,1431],{},[36,1428,1430],{"href":1429},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-com-and-pywin32\u002F","Automating Excel with COM and pywin32"," — EnsureDispatch and early binding.",[98,1433,1434,1438],{},[36,1435,1437],{"href":1436},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-com-and-pywin32\u002Fhandle-com-errors-and-excel-dialog-prompts-in-python\u002F","Handle COM Errors and Excel Dialog Prompts in Python"," — the errors Excel itself raises.",[98,1440,1441,1445],{},[36,1442,1444],{"href":1443},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-com-and-pywin32\u002Fclose-excel-cleanly-and-avoid-orphan-com-processes\u002F","Close Excel Cleanly and Avoid Orphan COM Processes"," — the other thing that breaks scheduled COM jobs.",[98,1447,1448,1450],{},[36,1449,1026],{"href":1025}," — running these jobs unattended.",[1452,1453,1454],"style",{},"html pre.shiki code .sMTad, html code.shiki .sMTad{--shiki-default:#6F42C1;--shiki-dark:#FFB757}html pre.shiki code .srMev, html code.shiki .srMev{--shiki-default:#032F62;--shiki-dark:#ADDCFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s-kum, html code.shiki .s-kum{--shiki-default:#D73A49;--shiki-dark:#FF9492}html pre.shiki code .skGVy, html code.shiki .skGVy{--shiki-default:#24292E;--shiki-dark:#F0F3F6}html pre.shiki code .sP0c6, html code.shiki .sP0c6{--shiki-default:#005CC5;--shiki-dark:#91CBFF}html pre.shiki code .s_Opv, html code.shiki .s_Opv{--shiki-default:#6F42C1;--shiki-dark:#DBB7FF}html pre.shiki code .sSjpA, html code.shiki .sSjpA{--shiki-default:#005CC5;--shiki-dark:#FF9492}html pre.shiki code .sa561, html code.shiki .sa561{--shiki-default:#E36209;--shiki-dark:#FFB757}html pre.shiki code .s-wDw, html code.shiki .s-wDw{--shiki-default:#6A737D;--shiki-dark:#BDC4CC}",{"title":20,"searchDepth":330,"depth":330,"links":1456},[1457,1458,1459,1460,1461,1462,1463,1464,1465,1466],{"id":44,"depth":330,"text":45},{"id":77,"depth":330,"text":78},{"id":306,"depth":330,"text":307},{"id":358,"depth":330,"text":359},{"id":898,"depth":330,"text":899},{"id":988,"depth":330,"text":989},{"id":1317,"depth":330,"text":1318},{"id":1357,"depth":330,"text":1358},{"id":1383,"depth":330,"text":1384},{"id":1415,"depth":330,"text":1416},"2026-09-29","Excel automation with pywin32 suddenly fails with an AttributeError saying a win32com.gen_py module has no attribute CLSIDToClassMap. The generated type-library cache is broken. Find the gen_py folder, delete just the Excel entry, let EnsureDispatch rebuild it, and stop it happening again on shared and scheduled machines.","md",[1471,1473,1475,1477],{"q":1389,"a":1472},"Print win32com.__gen_path__. By default it is a gen_py folder inside the user's temporary directory, with a subfolder per Python version, unless a gen_py folder exists inside the installed win32com package.",{"q":1399,"a":1474},"Yes. It only holds generated wrappers, which pywin32 recreates on demand. Deleting only the Excel entry and dicts.dat is enough and leaves wrappers for other applications in place.",{"q":1405,"a":1476},"It is the ID of Excel's type library followed by the locale and version of the library. The generated Python module for Excel is stored under that name.",{"q":1411,"a":1478},"dynamic.Dispatch avoids the cache but loses constants and early binding. Use it as a temporary workaround and clear the cache to fix the real problem.","fix win32com gen_py attributeerror",null,{"breadcrumb":1482},[1483,1485,1488],{"name":1484,"item":543},"Home",{"name":1486,"item":1487},"Getting Started with Python Excel Automation","\u002Fgetting-started-with-python-excel-automation\u002F",{"name":39,"item":38},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-win32com-gen-py-attributeerror",{"title":1491,"description":1492},"Fix win32com gen_py AttributeError: no attribute CLSIDToClassMap","Fix the pywin32 error 'module win32com.gen_py.00020813-… has no attribute CLSIDToClassMap': locate win32com.__gen_path__, delete the stale Excel cache, rebuild with EnsureDispatch or gencache, and prevent it.","fix-win32com-gen-py-attributeerror","getting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-win32com-gen-py-attributeerror\u002Findex",[1496,1497],"troubleshooting","com-automation","how-to","BLeA25dm3-UKsM9SwVUG775LSglpg1LMHGy3E5rgh0g",[1501,1505],{"title":1502,"path":1503,"stem":1504,"children":-1},"Fix \"ValueError: I\u002FO operation on closed file\" with ExcelWriter","\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-valueerror-io-operation-on-closed-file-with-excelwriter","getting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-valueerror-io-operation-on-closed-file-with-excelwriter\u002Findex",{"title":1506,"path":1507,"stem":1508,"children":-1},"Fix \"Workbook contains no default style\" Warning in openpyxl","\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-workbook-contains-no-default-style-warning","getting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-workbook-contains-no-default-style-warning\u002Findex",[1510,1512],{"path":1511,"title":1486},"\u002Fgetting-started-with-python-excel-automation",{"path":1513,"title":39},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors",[],[1516,1520,1523,1526,1529,1532],{"path":1517,"title":1518,"kind":1519},"\u002Fautomating-reporting-workflows\u002Ferror-handling-and-logging-in-excel-automation\u002Fhandle-permission-denied-when-writing-excel-in-python","Handle Permission Denied When Writing Excel in Python","fix",{"path":1521,"title":1522,"kind":1498},"\u002Fgetting-started-with-python-excel-automation\u002Fusing-openpyxl-for-excel-file-manipulation\u002Fwhat-openpyxl-loses-when-saving-an-existing-workbook","What openpyxl Loses When You Save an Existing Workbook",{"path":1524,"title":1525,"kind":1519},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-dates-and-times-in-excel-data\u002Ffix-excel-serial-numbers-showing-instead-of-dates","Fix Excel Serial Numbers Showing Instead of Dates",{"path":1527,"title":1528,"kind":1498},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-dates-and-times-in-excel-data\u002Fhandle-daylight-saving-time-in-excel-timestamps","Handle Daylight Saving Time in Excel Timestamps",{"path":1530,"title":1531,"kind":1498},"\u002Fautomating-reporting-workflows\u002Fautomating-excel-online-with-microsoft-graph\u002Fhandle-microsoft-graph-throttling-for-excel","Handle Microsoft Graph Throttling in Excel Automation",{"path":1533,"title":1534,"kind":1535},"\u002Fautomating-reporting-workflows\u002Ferror-handling-and-logging-in-excel-automation","Error Handling and Logging in Excel Automation","guide",1790972067662]