[{"data":1,"prerenderedAt":1775},["ShallowReactive",2],{"doc:\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-workbook-contains-no-default-style-warning":3,"surround:\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-workbook-contains-no-default-style-warning":1740,"ancestors:\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-workbook-contains-no-default-style-warning":1749,"children:\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-workbook-contains-no-default-style-warning":1754,"related:\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-workbook-contains-no-default-style-warning":1755},{"id":4,"title":5,"body":6,"dateModified":1706,"datePublished":1706,"description":1707,"extension":1708,"faq":1709,"keyword":1718,"kind":1719,"meta":1720,"navigation":295,"path":1729,"seo":1730,"slug":1733,"stem":1734,"topics":1735,"type":1738,"__hash__":1739},"docs\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-workbook-contains-no-default-style-warning\u002Findex.md","Fix \"Workbook contains no default style\" Warning in openpyxl",{"type":7,"value":8,"toc":1692},"minimark",[9,13,24,42,198,203,242,253,257,260,414,434,438,452,694,709,713,720,795,813,816,893,897,908,989,997,1186,1190,1193,1309,1312,1315,1374,1377,1381,1384,1565,1569,1610,1614,1617,1621,1627,1631,1637,1643,1649,1655,1659,1688],[10,11,12],"p",{},"Reading a workbook exported by another system prints this, sometimes once per file in a batch job's log:",[14,15,21],"pre",{"className":16,"code":18,"language":19,"meta":20},[17],"language-text","UserWarning: Workbook contains no default style, apply openpyxl's default\n","text","",[22,23,18],"code",{"__ignoreMap":20},[10,25,26,27,30,31,35,36,41],{},"It is a warning, not an error, and in most cases the DataFrame is exactly what you expected. The file's stylesheet — the ",[22,28,29],{},"xl\u002Fstyles.xml"," part that holds fonts, fills and number formats — is missing the entry for Excel's \"Normal\" style, and openpyxl fills the gap with its own. Programs that are not Excel often write a minimal stylesheet like this. There is a close cousin, though, that is ",[32,33,34],"em",{},"not"," harmless, and the two are easy to confuse. This page, part of ",[37,38,40],"a",{"href":39},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002F","Troubleshooting Common Python Excel Errors",", shows how to tell them apart and what to do about each.",[43,44,52,53,52,57,52,61,52,69,52,79,52,90,52,96,52,103,52,109,52,115,52,119,52,124,52,128,52,133,52,137,52,142,52,147,52,154,52,159,52,163,52,167,52,174,52,177,52,182,52,185,52,190,52,193],"svg",{"viewBox":45,"role":46,"ariaLabelledBy":47,"xmlns":50,"style":51},"4 0 752 233","img",[48,49],"nds-two-t","nds-two-d","http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg","width:100%;max-width:752px;height:auto;display:block;margin:1.5rem auto;font-family:Inter,ui-sans-serif,system-ui,sans-serif","\n  ",[54,55,56],"title",{"id":48},"Two stylesheet warnings with different consequences",[58,59,60],"desc",{"id":49},"Two panels. \"No default style\" means the Normal style entry is missing: values, number formats and dates all read correctly, and the warning is safe to silence. \"No stylesheet\" means the cell formats are missing: numbers read correctly but date cells arrive as serial numbers, which must be converted.",[62,63],"rect",{"x":64,"y":65,"width":66,"height":67,"fill":68},"4","0","752","233","#ffffff",[62,70],{"x":71,"y":72,"width":73,"height":74,"rx":75,"fill":76,"stroke":77,"style":78},"20.0","16.0","351.0","201.0","14","#d9f4f1","var(--teal,#0f9488)","stroke-width:2px",[80,81,83],"g",{"transform":82},"translate(182.5,29.0) scale(1.083)",[84,85],"path",{"d":86,"fill":87,"stroke":88,"style":89},"M5 12.5l4.5 4.5L19 7","none","var(--teal-ink,#0b6157)","stroke-width:1.66px;stroke-linecap:round;stroke-linejoin:round",[19,91,95],{"x":92,"y":93,"style":94},"195.5","78.0","font-size:14px;font-weight:700;fill:var(--teal-ink,#0b6157);text-anchor:middle","Workbook contains no default style",[97,98],"line",{"x1":99,"y1":100,"x2":101,"y2":100,"stroke":77,"style":102},"36.0","91.0","355.0","stroke-width:1px",[19,104,108],{"x":105,"y":106,"style":107},"60.0","111.0","font-size:12px;font-weight:400;fill:var(--text,#172033);text-anchor:start","Normal style entry missing",[80,110,112],{"transform":111},"translate(38.5,99.5) scale(0.625)",[84,113],{"d":86,"fill":87,"stroke":77,"style":114},"stroke-width:2.88px;stroke-linecap:round;stroke-linejoin:round",[19,116,118],{"x":105,"y":117,"style":107},"137.0","number formats present",[80,120,122],{"transform":121},"translate(38.5,125.5) scale(0.625)",[84,123],{"d":86,"fill":87,"stroke":77,"style":114},[19,125,127],{"x":105,"y":126,"style":107},"163.0","dates read as dates",[80,129,131],{"transform":130},"translate(38.5,151.5) scale(0.625)",[84,132],{"d":86,"fill":87,"stroke":77,"style":114},[19,134,136],{"x":105,"y":135,"style":107},"189.0","safe to silence",[80,138,140],{"transform":139},"translate(38.5,177.5) scale(0.625)",[84,141],{"d":86,"fill":87,"stroke":77,"style":114},[62,143],{"x":144,"y":72,"width":73,"height":74,"rx":75,"fill":145,"stroke":146,"style":78},"389.0","#fdefd8","var(--gold,#b4740a)",[80,148,150],{"transform":149},"translate(551.5,29.0) scale(1.083)",[84,151],{"d":152,"fill":87,"stroke":153,"style":89},"M12 3.5l9.5 17h-19z M12 10v5 M12 17.8v.4","var(--gold-ink,#7a4e06)",[19,155,158],{"x":156,"y":93,"style":157},"564.5","font-size:14px;font-weight:700;fill:var(--gold-ink,#7a4e06);text-anchor:middle","Workbook contains no stylesheet",[97,160],{"x1":161,"y1":100,"x2":162,"y2":100,"stroke":146,"style":102},"405.0","724.0",[19,164,166],{"x":165,"y":106,"style":107},"429.0","cell formats missing",[80,168,170],{"transform":169},"translate(407.5,99.5) scale(0.625)",[84,171],{"d":172,"fill":87,"stroke":173,"style":114},"M6 6l12 12 M18 6L6 18","var(--accent,#f43f8f)",[19,175,176],{"x":165,"y":117,"style":107},"dates arrive as numbers",[80,178,180],{"transform":179},"translate(407.5,125.5) scale(0.625)",[84,181],{"d":172,"fill":87,"stroke":173,"style":114},[19,183,184],{"x":165,"y":126,"style":107},"numbers and text fine",[80,186,188],{"transform":187},"translate(407.5,151.5) scale(0.625)",[84,189],{"d":152,"fill":87,"stroke":146,"style":114},[19,191,192],{"x":165,"y":135,"style":107},"convert date columns",[80,194,196],{"transform":195},"translate(407.5,177.5) scale(0.625)",[84,197],{"d":152,"fill":87,"stroke":146,"style":114},[199,200,202],"h2",{"id":201},"prerequisites","Prerequisites",[14,204,208],{"className":205,"code":206,"language":207,"meta":20,"style":20},"language-bash shiki shiki-themes github-light github-dark-high-contrast","pip install pandas openpyxl\npip install python-calamine   # optional, for Step 4\n","bash",[22,209,210,228],{"__ignoreMap":20},[211,212,214,218,222,225],"span",{"class":97,"line":213},1,[211,215,217],{"class":216},"sMTad","pip",[211,219,221],{"class":220},"srMev"," install",[211,223,224],{"class":220}," pandas",[211,226,227],{"class":220}," openpyxl\n",[211,229,231,233,235,238],{"class":97,"line":230},2,[211,232,217],{"class":216},[211,234,221],{"class":220},[211,236,237],{"class":220}," python-calamine",[211,239,241],{"class":240},"s-wDw","   # optional, for Step 4\n",[10,243,244,245,248,249,252],{},"The examples use two small files that reproduce each case: ",[22,246,247],{},"export.xlsx",", whose stylesheet lacks the Normal style, and ",[22,250,251],{},"bare.xlsx",", whose stylesheet lacks cell formats altogether. Both hold the same two rows: a posting date and an amount.",[199,254,256],{"id":255},"step-1-check-which-warning-you-have-and-what-it-touched","Step 1 — Check which warning you have and what it touched",[10,258,259],{},"Capture the warnings rather than reading them off the console, so you can see the exact text and compare the data from each file:",[14,261,265],{"className":262,"code":263,"language":264,"meta":20,"style":20},"language-python shiki shiki-themes github-light github-dark-high-contrast","import warnings\nimport pandas as pd\n\nfor name in (\"export.xlsx\", \"bare.xlsx\"):\n    with warnings.catch_warnings(record=True) as caught:\n        warnings.simplefilter(\"always\")\n        frame = pd.read_excel(name)\n    print(name, [str(w.message) for w in caught])\n    print(frame.to_dict(\"records\"))\n","python",[22,266,267,277,290,297,324,352,364,375,400],{"__ignoreMap":20},[211,268,269,273],{"class":97,"line":213},[211,270,272],{"class":271},"s-kum","import",[211,274,276],{"class":275},"skGVy"," warnings\n",[211,278,279,281,284,287],{"class":97,"line":230},[211,280,272],{"class":271},[211,282,283],{"class":275}," pandas ",[211,285,286],{"class":271},"as",[211,288,289],{"class":275}," pd\n",[211,291,293],{"class":97,"line":292},3,[211,294,296],{"emptyLinePlaceholder":295},true,"\n",[211,298,300,303,306,309,312,315,318,321],{"class":97,"line":299},4,[211,301,302],{"class":271},"for",[211,304,305],{"class":275}," name ",[211,307,308],{"class":271},"in",[211,310,311],{"class":275}," (",[211,313,314],{"class":220},"\"export.xlsx\"",[211,316,317],{"class":275},", ",[211,319,320],{"class":220},"\"bare.xlsx\"",[211,322,323],{"class":275},"):\n",[211,325,327,330,333,337,340,344,347,349],{"class":97,"line":326},5,[211,328,329],{"class":271},"    with",[211,331,332],{"class":275}," warnings.catch_warnings(",[211,334,336],{"class":335},"sa561","record",[211,338,339],{"class":271},"=",[211,341,343],{"class":342},"sP0c6","True",[211,345,346],{"class":275},") ",[211,348,286],{"class":271},[211,350,351],{"class":275}," caught:\n",[211,353,355,358,361],{"class":97,"line":354},6,[211,356,357],{"class":275},"        warnings.simplefilter(",[211,359,360],{"class":220},"\"always\"",[211,362,363],{"class":275},")\n",[211,365,367,370,372],{"class":97,"line":366},7,[211,368,369],{"class":275},"        frame ",[211,371,339],{"class":271},[211,373,374],{"class":275}," pd.read_excel(name)\n",[211,376,378,381,384,387,390,392,395,397],{"class":97,"line":377},8,[211,379,380],{"class":342},"    print",[211,382,383],{"class":275},"(name, [",[211,385,386],{"class":342},"str",[211,388,389],{"class":275},"(w.message) ",[211,391,302],{"class":271},[211,393,394],{"class":275}," w ",[211,396,308],{"class":271},[211,398,399],{"class":275}," caught])\n",[211,401,403,405,408,411],{"class":97,"line":402},9,[211,404,380],{"class":342},[211,406,407],{"class":275},"(frame.to_dict(",[211,409,410],{"class":220},"\"records\"",[211,412,413],{"class":275},"))\n",[10,415,416,418,419,422,423,425,426,429,430,433],{},[22,417,247],{}," warns about the default style and still gives you ",[22,420,421],{},"Timestamp('2026-03-01 00:00:00')",". ",[22,424,251],{}," warns that there is no stylesheet and gives you ",[22,427,428],{},"46082"," — the date's serial number. A number format is what marks a cell as a date in an ",[22,431,432],{},".xlsx"," file; the value underneath is always a plain number. Remove the formats and the reader has no way to know those numbers were ever dates.",[199,435,437],{"id":436},"look-inside-the-stylesheet","Look inside the stylesheet",[10,439,440,441,443,444,447,448,451],{},"An ",[22,442,432],{}," file is a zip archive, and the stylesheet is one XML file inside it. Opening it directly shows which section is missing, which is useful evidence when you report the problem to whoever produces the files. The two sections that matter here are ",[22,445,446],{},"cellXfs",", the list of cell formats that every styled cell points into, and ",[22,449,450],{},"cellStyles",", the list of named styles such as Normal:",[14,453,455],{"className":262,"code":454,"language":264,"meta":20,"style":20},"import re\nimport zipfile\n\ndef stylesheet_report(path):\n    with zipfile.ZipFile(path) as z:\n        if \"xl\u002Fstyles.xml\" not in z.namelist():\n            return \"no styles.xml part at all\"\n        xml = z.read(\"xl\u002Fstyles.xml\").decode(\"utf-8\")\n    parts = {}\n    for tag in (\"numFmts\", \"cellXfs\", \"cellStyles\"):\n        m = re.search(rf'\u003C{tag} count=\"(\\d+)\"', xml)\n        parts[tag] = int(m.group(1)) if m else \"missing\"\n    return parts\n\nfor name in (\"source.xlsx\", \"export.xlsx\", \"bare.xlsx\"):\n    print(name, stylesheet_report(name))\n",[22,456,457,464,471,475,487,499,516,524,545,555,583,616,648,657,662,686],{"__ignoreMap":20},[211,458,459,461],{"class":97,"line":213},[211,460,272],{"class":271},[211,462,463],{"class":275}," re\n",[211,465,466,468],{"class":97,"line":230},[211,467,272],{"class":271},[211,469,470],{"class":275}," zipfile\n",[211,472,473],{"class":97,"line":292},[211,474,296],{"emptyLinePlaceholder":295},[211,476,477,480,484],{"class":97,"line":299},[211,478,479],{"class":271},"def",[211,481,483],{"class":482},"s_Opv"," stylesheet_report",[211,485,486],{"class":275},"(path):\n",[211,488,489,491,494,496],{"class":97,"line":326},[211,490,329],{"class":271},[211,492,493],{"class":275}," zipfile.ZipFile(path) ",[211,495,286],{"class":271},[211,497,498],{"class":275}," z:\n",[211,500,501,504,507,510,513],{"class":97,"line":354},[211,502,503],{"class":271},"        if",[211,505,506],{"class":220}," \"xl\u002Fstyles.xml\"",[211,508,509],{"class":271}," not",[211,511,512],{"class":271}," in",[211,514,515],{"class":275}," z.namelist():\n",[211,517,518,521],{"class":97,"line":366},[211,519,520],{"class":271},"            return",[211,522,523],{"class":220}," \"no styles.xml part at all\"\n",[211,525,526,529,531,534,537,540,543],{"class":97,"line":377},[211,527,528],{"class":275},"        xml ",[211,530,339],{"class":271},[211,532,533],{"class":275}," z.read(",[211,535,536],{"class":220},"\"xl\u002Fstyles.xml\"",[211,538,539],{"class":275},").decode(",[211,541,542],{"class":220},"\"utf-8\"",[211,544,363],{"class":275},[211,546,547,550,552],{"class":97,"line":402},[211,548,549],{"class":275},"    parts ",[211,551,339],{"class":271},[211,553,554],{"class":275}," {}\n",[211,556,558,561,564,566,568,571,573,576,578,581],{"class":97,"line":557},10,[211,559,560],{"class":271},"    for",[211,562,563],{"class":275}," tag ",[211,565,308],{"class":271},[211,567,311],{"class":275},[211,569,570],{"class":220},"\"numFmts\"",[211,572,317],{"class":275},[211,574,575],{"class":220},"\"cellXfs\"",[211,577,317],{"class":275},[211,579,580],{"class":220},"\"cellStyles\"",[211,582,323],{"class":275},[211,584,586,589,591,594,597,600,604,607,610,613],{"class":97,"line":585},11,[211,587,588],{"class":275},"        m ",[211,590,339],{"class":271},[211,592,593],{"class":275}," re.search(",[211,595,596],{"class":271},"rf",[211,598,599],{"class":220},"'\u003C",[211,601,603],{"class":602},"sSjpA","{",[211,605,606],{"class":275},"tag",[211,608,609],{"class":602},"}",[211,611,612],{"class":220}," count=\"(\\d+)\"'",[211,614,615],{"class":275},", xml)\n",[211,617,619,622,624,627,630,633,636,639,642,645],{"class":97,"line":618},12,[211,620,621],{"class":275},"        parts[tag] ",[211,623,339],{"class":271},[211,625,626],{"class":342}," int",[211,628,629],{"class":275},"(m.group(",[211,631,632],{"class":342},"1",[211,634,635],{"class":275},")) ",[211,637,638],{"class":271},"if",[211,640,641],{"class":275}," m ",[211,643,644],{"class":271},"else",[211,646,647],{"class":220}," \"missing\"\n",[211,649,651,654],{"class":97,"line":650},13,[211,652,653],{"class":271},"    return",[211,655,656],{"class":275}," parts\n",[211,658,660],{"class":97,"line":659},14,[211,661,296],{"emptyLinePlaceholder":295},[211,663,665,667,669,671,673,676,678,680,682,684],{"class":97,"line":664},15,[211,666,302],{"class":271},[211,668,305],{"class":275},[211,670,308],{"class":271},[211,672,311],{"class":275},[211,674,675],{"class":220},"\"source.xlsx\"",[211,677,317],{"class":275},[211,679,314],{"class":220},[211,681,317],{"class":275},[211,683,320],{"class":220},[211,685,323],{"class":275},[211,687,689,691],{"class":97,"line":688},16,[211,690,380],{"class":342},[211,692,693],{"class":275},"(name, stylesheet_report(name))\n",[10,695,696,697,699,700,702,703,705,706,708],{},"The file Excel or pandas writes has all three sections. ",[22,698,247],{}," is missing only ",[22,701,450],{}," — the Normal style — which is what the default-style warning reports. ",[22,704,251],{}," is missing ",[22,707,446],{},", so no cell can point at a date format, and that is why its dates come back as plain numbers. The report takes a fraction of a second, so it is cheap to run over a whole folder of exports when you want to know how many files are affected before deciding between a filter and a conversion.",[199,710,712],{"id":711},"step-2-silence-the-harmless-warning-precisely","Step 2 — Silence the harmless warning precisely",[10,714,715,716,719],{},"For the default-style case, filter the warning — but only that warning, from that module. A blanket ",[22,717,718],{},"warnings.filterwarnings(\"ignore\")"," also hides the ones you need, including the no-stylesheet warning that tells you dates are about to go wrong:",[14,721,723],{"className":262,"code":722,"language":264,"meta":20,"style":20},"warnings.filterwarnings(\n    \"ignore\",\n    message=\"Workbook contains no default style\",\n    category=UserWarning,\n    module=\"openpyxl\",\n)\n\nprint(pd.read_excel(\"export.xlsx\").dtypes.to_dict())\n",[22,724,725,730,738,750,762,774,778,782],{"__ignoreMap":20},[211,726,727],{"class":97,"line":213},[211,728,729],{"class":275},"warnings.filterwarnings(\n",[211,731,732,735],{"class":97,"line":230},[211,733,734],{"class":220},"    \"ignore\"",[211,736,737],{"class":275},",\n",[211,739,740,743,745,748],{"class":97,"line":292},[211,741,742],{"class":335},"    message",[211,744,339],{"class":271},[211,746,747],{"class":220},"\"Workbook contains no default style\"",[211,749,737],{"class":275},[211,751,752,755,757,760],{"class":97,"line":299},[211,753,754],{"class":335},"    category",[211,756,339],{"class":271},[211,758,759],{"class":342},"UserWarning",[211,761,737],{"class":275},[211,763,764,767,769,772],{"class":97,"line":326},[211,765,766],{"class":335},"    module",[211,768,339],{"class":271},[211,770,771],{"class":220},"\"openpyxl\"",[211,773,737],{"class":275},[211,775,776],{"class":97,"line":354},[211,777,363],{"class":275},[211,779,780],{"class":97,"line":366},[211,781,296],{"emptyLinePlaceholder":295},[211,783,784,787,790,792],{"class":97,"line":377},[211,785,786],{"class":342},"print",[211,788,789],{"class":275},"(pd.read_excel(",[211,791,314],{"class":220},[211,793,794],{"class":275},").dtypes.to_dict())\n",[10,796,797,800,801,804,805,808,809,812],{},[22,798,799],{},"message"," is a regular expression matched against the start of the warning text, and ",[22,802,803],{},"module"," is matched against the module that raised it — here ",[22,806,807],{},"openpyxl.styles.stylesheet",", which the pattern ",[22,810,811],{},"openpyxl"," covers. Put the filter at the top of the script's entry point, not inside a library function, so it is visible to whoever reads the job next.",[10,814,815],{},"When only one call should be quiet, scope the filter to it with a context manager instead:",[14,817,819],{"className":262,"code":818,"language":264,"meta":20,"style":20},"with warnings.catch_warnings():\n    warnings.filterwarnings(\"ignore\", message=\"Workbook contains no default style\",\n                            category=UserWarning, module=\"openpyxl\")\n    ledger = pd.read_excel(\"export.xlsx\")\nprint(len(ledger))\n",[22,820,821,829,847,866,880],{"__ignoreMap":20},[211,822,823,826],{"class":97,"line":213},[211,824,825],{"class":271},"with",[211,827,828],{"class":275}," warnings.catch_warnings():\n",[211,830,831,834,837,839,841,843,845],{"class":97,"line":230},[211,832,833],{"class":275},"    warnings.filterwarnings(",[211,835,836],{"class":220},"\"ignore\"",[211,838,317],{"class":275},[211,840,799],{"class":335},[211,842,339],{"class":271},[211,844,747],{"class":220},[211,846,737],{"class":275},[211,848,849,852,854,856,858,860,862,864],{"class":97,"line":292},[211,850,851],{"class":335},"                            category",[211,853,339],{"class":271},[211,855,759],{"class":342},[211,857,317],{"class":275},[211,859,803],{"class":335},[211,861,339],{"class":271},[211,863,771],{"class":220},[211,865,363],{"class":275},[211,867,868,871,873,876,878],{"class":97,"line":299},[211,869,870],{"class":275},"    ledger ",[211,872,339],{"class":271},[211,874,875],{"class":275}," pd.read_excel(",[211,877,314],{"class":220},[211,879,363],{"class":275},[211,881,882,884,887,890],{"class":97,"line":326},[211,883,786],{"class":342},[211,885,886],{"class":275},"(",[211,888,889],{"class":342},"len",[211,891,892],{"class":275},"(ledger))\n",[199,894,896],{"id":895},"step-3-repair-dates-when-the-stylesheet-is-missing","Step 3 — Repair dates when the stylesheet is missing",[10,898,899,900,903,904,907],{},"For the no-stylesheet case, convert the affected columns yourself. Excel's serial numbers count days from 30 December 1899, so ",[22,901,902],{},"pd.to_datetime"," with that origin and ",[22,905,906],{},"unit=\"D\""," turns them back into dates:",[14,909,911],{"className":262,"code":910,"language":264,"meta":20,"style":20},"bare = pd.read_excel(\"bare.xlsx\")\nprint(bare.dtypes.to_dict())\n\nbare[\"posted\"] = pd.to_datetime(bare[\"posted\"], unit=\"D\", origin=\"1899-12-30\")\nprint(bare.to_dict(\"records\"))\n",[22,912,913,926,933,937,978],{"__ignoreMap":20},[211,914,915,918,920,922,924],{"class":97,"line":213},[211,916,917],{"class":275},"bare ",[211,919,339],{"class":271},[211,921,875],{"class":275},[211,923,320],{"class":220},[211,925,363],{"class":275},[211,927,928,930],{"class":97,"line":230},[211,929,786],{"class":342},[211,931,932],{"class":275},"(bare.dtypes.to_dict())\n",[211,934,935],{"class":97,"line":292},[211,936,296],{"emptyLinePlaceholder":295},[211,938,939,942,945,948,950,953,955,958,961,963,966,968,971,973,976],{"class":97,"line":299},[211,940,941],{"class":275},"bare[",[211,943,944],{"class":220},"\"posted\"",[211,946,947],{"class":275},"] ",[211,949,339],{"class":271},[211,951,952],{"class":275}," pd.to_datetime(bare[",[211,954,944],{"class":220},[211,956,957],{"class":275},"], ",[211,959,960],{"class":335},"unit",[211,962,339],{"class":271},[211,964,965],{"class":220},"\"D\"",[211,967,317],{"class":275},[211,969,970],{"class":335},"origin",[211,972,339],{"class":271},[211,974,975],{"class":220},"\"1899-12-30\"",[211,977,363],{"class":275},[211,979,980,982,985,987],{"class":97,"line":326},[211,981,786],{"class":342},[211,983,984],{"class":275},"(bare.to_dict(",[211,986,410],{"class":220},[211,988,413],{"class":275},[10,990,991,992,996],{},"Convert only columns you know are dates. A quantity column holding 46082 is a quantity, and there is nothing in the file to distinguish it. If the export's layout is fixed, list the date columns in the job's configuration and convert them by name; ",[37,993,995],{"href":994},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-dates-and-times-in-excel-data\u002Ffix-excel-serial-numbers-showing-instead-of-dates\u002F","Fix Excel Serial Numbers Showing Instead of Dates"," covers the conversion in depth, including time fractions and the 1904 date system.",[43,998,52,1004,52,1007,52,1010,52,1015,52,1023,52,1027,52,1033,52,1037,52,1041,52,1045,52,1049,52,1051,52,1055,52,1057,52,1060,52,1063,52,1066,52,1069,52,1072,52,1074,52,1078,52,1081,52,1085,52,1087,52,1090,52,1092,52,1095,52,1098,52,1102,52,1105,52,1108,52,1111,52,1113,52,1116,52,1118,52,1120,52,1122,52,1124,52,1126,52,1128,52,1130,52,1134,52,1136,52,1138,52,1140,52,1142,52,1144,52,1147,52,1149,52,1151,52,1157,52,1161,52,1167,52,1172,52,1180],{"viewBox":999,"role":46,"ariaLabelledBy":1000,"xmlns":50,"style":1003},"49 0 662 164",[1001,1002],"nds-serial-t","nds-serial-d","width:100%;max-width:662px;height:auto;display:block;margin:1.5rem auto;font-family:Inter,ui-sans-serif,system-ui,sans-serif",[54,1005,1006],{"id":1001},"Restoring dates from a file with no cell formats",[58,1008,1009],{"id":1002},"Left: the posted column read from bare.xlsx holds serial numbers 46082 and 46083. Right: after pd.to_datetime with unit D and origin 1899-12-30, the same column holds the dates 2026-03-01 and 2026-03-02.",[62,1011],{"x":1012,"y":65,"width":1013,"height":1014,"fill":68},"49","662","164",[62,1016],{"x":1017,"y":1018,"width":1019,"height":1020,"rx":65,"fill":1021,"stroke":1022,"style":102},"65.1","40.0","32.0","24.0","#e7ebef","var(--line,#cdd5e6)",[62,1024],{"x":1025,"y":1018,"width":1026,"height":1020,"rx":65,"fill":1021,"stroke":1022,"style":102},"97.1","66.8",[19,1028,1032],{"x":1029,"y":1030,"style":1031},"130.5","57.0","font-size:11px;font-weight:600;fill:var(--muted,#5b6780);text-anchor:middle","A",[62,1034],{"x":1035,"y":1018,"width":1036,"height":1020,"rx":65,"fill":1021,"stroke":1022,"style":102},"163.9","70.9",[19,1038,1040],{"x":1039,"y":1030,"style":1031},"199.4","B",[62,1042],{"x":1017,"y":1043,"width":1019,"height":1044,"rx":65,"fill":1021,"stroke":1022,"style":102},"64.0","28.0",[19,1046,632],{"x":1047,"y":1048,"style":1031},"81.1","83.0",[62,1050],{"x":1025,"y":1043,"width":1026,"height":1044,"rx":65,"fill":68,"stroke":1022,"style":102},[19,1052,1054],{"x":1029,"y":1048,"style":1053},"font-size:12px;font-weight:700;fill:var(--text,#172033);text-anchor:middle","posted",[62,1056],{"x":1035,"y":1043,"width":1036,"height":1044,"rx":65,"fill":68,"stroke":1022,"style":102},[19,1058,1059],{"x":1039,"y":1048,"style":1053},"amount",[62,1061],{"x":1017,"y":1062,"width":1019,"height":1044,"rx":65,"fill":1021,"stroke":1022,"style":102},"92.0",[19,1064,1065],{"x":1047,"y":106,"style":1031},"2",[62,1067],{"x":1025,"y":1062,"width":1026,"height":1044,"rx":65,"fill":145,"stroke":146,"style":1068},"stroke-width:1.5px",[19,1070,428],{"x":1029,"y":106,"style":1071},"font-size:12px;font-weight:700;fill:var(--gold-ink,#7a4e06);text-anchor:middle",[62,1073],{"x":1035,"y":1062,"width":1036,"height":1044,"rx":65,"fill":68,"stroke":1022,"style":102},[19,1075,1077],{"x":1039,"y":106,"style":1076},"font-size:12px;font-weight:400;fill:var(--text,#172033);text-anchor:middle","120.5",[62,1079],{"x":1017,"y":1080,"width":1019,"height":1044,"rx":65,"fill":1021,"stroke":1022,"style":102},"120.0",[19,1082,1084],{"x":1047,"y":1083,"style":1031},"139.0","3",[62,1086],{"x":1025,"y":1080,"width":1026,"height":1044,"rx":65,"fill":145,"stroke":146,"style":1068},[19,1088,1089],{"x":1029,"y":1083,"style":1071},"46083",[62,1091],{"x":1035,"y":1080,"width":1036,"height":1044,"rx":65,"fill":68,"stroke":1022,"style":102},[19,1093,1094],{"x":1039,"y":1083,"style":1076},"88",[62,1096],{"x":1097,"y":1018,"width":1019,"height":1020,"rx":65,"fill":1021,"stroke":1022,"style":102},"490.6",[62,1099],{"x":1100,"y":1018,"width":1101,"height":1020,"rx":65,"fill":1021,"stroke":1022,"style":102},"522.6","101.4",[19,1103,1032],{"x":1104,"y":1030,"style":1031},"573.3",[62,1106],{"x":1107,"y":1018,"width":1036,"height":1020,"rx":65,"fill":1021,"stroke":1022,"style":102},"624.0",[19,1109,1040],{"x":1110,"y":1030,"style":1031},"659.4",[62,1112],{"x":1097,"y":1043,"width":1019,"height":1044,"rx":65,"fill":1021,"stroke":1022,"style":102},[19,1114,632],{"x":1115,"y":1048,"style":1031},"506.6",[62,1117],{"x":1100,"y":1043,"width":1101,"height":1044,"rx":65,"fill":68,"stroke":1022,"style":102},[19,1119,1054],{"x":1104,"y":1048,"style":1053},[62,1121],{"x":1107,"y":1043,"width":1036,"height":1044,"rx":65,"fill":68,"stroke":1022,"style":102},[19,1123,1059],{"x":1110,"y":1048,"style":1053},[62,1125],{"x":1097,"y":1062,"width":1019,"height":1044,"rx":65,"fill":1021,"stroke":1022,"style":102},[19,1127,1065],{"x":1115,"y":106,"style":1031},[62,1129],{"x":1100,"y":1062,"width":1101,"height":1044,"rx":65,"fill":76,"stroke":77,"style":1068},[19,1131,1133],{"x":1104,"y":106,"style":1132},"font-size:12px;font-weight:700;fill:var(--teal-ink,#0b6157);text-anchor:middle","2026-03-01",[62,1135],{"x":1107,"y":1062,"width":1036,"height":1044,"rx":65,"fill":68,"stroke":1022,"style":102},[19,1137,1077],{"x":1110,"y":106,"style":1076},[62,1139],{"x":1097,"y":1080,"width":1019,"height":1044,"rx":65,"fill":1021,"stroke":1022,"style":102},[19,1141,1084],{"x":1115,"y":1083,"style":1031},[62,1143],{"x":1100,"y":1080,"width":1101,"height":1044,"rx":65,"fill":76,"stroke":77,"style":1068},[19,1145,1146],{"x":1104,"y":1083,"style":1132},"2026-03-02",[62,1148],{"x":1107,"y":1080,"width":1036,"height":1044,"rx":65,"fill":68,"stroke":1022,"style":102},[19,1150,1094],{"x":1110,"y":1083,"style":1076},[19,1152,1156],{"x":1153,"y":1154,"style":1155},"150.0","29.0","font-size:12.5px;font-weight:700;fill:var(--muted,#5b6780);text-anchor:middle","read from bare.xlsx",[19,1158,1160],{"x":1159,"y":1154,"style":1155},"592.7","after conversion",[97,1162],{"x1":1163,"y1":1164,"x2":1165,"y2":1164,"stroke":1166,"style":78},"244.8","94.0","476.6","var(--brand,#5b5cf0)",[1168,1169],"polygon",{"points":1170,"fill":1171},"480.6,94.0 471.6,99.0 471.6,89.0","#5b5cf0",[62,1173],{"x":1174,"y":1175,"width":1176,"height":1177,"rx":1178,"fill":68,"stroke":1022,"style":1179},"276.4","61.0","172.7","22.0","11","stroke-width:1.2px",[19,1181,1185],{"x":1182,"y":1183,"style":1184},"362.7","76.0","font-size:11.5px;font-weight:400;fill:var(--brand-strong,#4338ca);text-anchor:middle;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace","to_datetime(unit=\"D\")",[199,1187,1189],{"id":1188},"step-4-repair-the-file-or-read-it-with-a-different-engine","Step 4 — Repair the file, or read it with a different engine",[10,1191,1192],{},"If the file is an intermediate you control — something your pipeline downloads and then processes in several steps — repair it once. Loading with openpyxl and saving writes a complete stylesheet, including a Normal style, so later readers see no warning:",[14,1194,1196],{"className":262,"code":1195,"language":264,"meta":20,"style":20},"from openpyxl import load_workbook\n\nwith warnings.catch_warnings():\n    warnings.simplefilter(\"ignore\")\n    wb = load_workbook(\"export.xlsx\")\nwb.save(\"export_repaired.xlsx\")\n\nwith warnings.catch_warnings(record=True) as caught:\n    warnings.simplefilter(\"always\")\n    pd.read_excel(\"export_repaired.xlsx\")\nprint(len(caught))\n# 0\n",[22,1197,1198,1211,1215,1221,1230,1244,1254,1258,1276,1284,1293,1304],{"__ignoreMap":20},[211,1199,1200,1203,1206,1208],{"class":97,"line":213},[211,1201,1202],{"class":271},"from",[211,1204,1205],{"class":275}," openpyxl ",[211,1207,272],{"class":271},[211,1209,1210],{"class":275}," load_workbook\n",[211,1212,1213],{"class":97,"line":230},[211,1214,296],{"emptyLinePlaceholder":295},[211,1216,1217,1219],{"class":97,"line":292},[211,1218,825],{"class":271},[211,1220,828],{"class":275},[211,1222,1223,1226,1228],{"class":97,"line":299},[211,1224,1225],{"class":275},"    warnings.simplefilter(",[211,1227,836],{"class":220},[211,1229,363],{"class":275},[211,1231,1232,1235,1237,1240,1242],{"class":97,"line":326},[211,1233,1234],{"class":275},"    wb ",[211,1236,339],{"class":271},[211,1238,1239],{"class":275}," load_workbook(",[211,1241,314],{"class":220},[211,1243,363],{"class":275},[211,1245,1246,1249,1252],{"class":97,"line":354},[211,1247,1248],{"class":275},"wb.save(",[211,1250,1251],{"class":220},"\"export_repaired.xlsx\"",[211,1253,363],{"class":275},[211,1255,1256],{"class":97,"line":366},[211,1257,296],{"emptyLinePlaceholder":295},[211,1259,1260,1262,1264,1266,1268,1270,1272,1274],{"class":97,"line":377},[211,1261,825],{"class":271},[211,1263,332],{"class":275},[211,1265,336],{"class":335},[211,1267,339],{"class":271},[211,1269,343],{"class":342},[211,1271,346],{"class":275},[211,1273,286],{"class":271},[211,1275,351],{"class":275},[211,1277,1278,1280,1282],{"class":97,"line":402},[211,1279,1225],{"class":275},[211,1281,360],{"class":220},[211,1283,363],{"class":275},[211,1285,1286,1289,1291],{"class":97,"line":557},[211,1287,1288],{"class":275},"    pd.read_excel(",[211,1290,1251],{"class":220},[211,1292,363],{"class":275},[211,1294,1295,1297,1299,1301],{"class":97,"line":585},[211,1296,786],{"class":342},[211,1298,886],{"class":275},[211,1300,889],{"class":342},[211,1302,1303],{"class":275},"(caught))\n",[211,1305,1306],{"class":97,"line":618},[211,1307,1308],{"class":240},"# 0\n",[10,1310,1311],{},"Resaving does not bring back lost date formats in the no-stylesheet case — the information is not in the file to restore. It only stops the warning.",[10,1313,1314],{},"The calamine engine reads the workbook without going through openpyxl's stylesheet code, so it does not emit the warning at all. It is also considerably faster, which makes it a sensible default for batch jobs that only need values:",[14,1316,1318],{"className":262,"code":1317,"language":264,"meta":20,"style":20},"try:\n    print(pd.read_excel(\"export.xlsx\", engine=\"calamine\").to_dict(\"records\"))\nexcept ImportError:\n    print(\"pip install python-calamine to use this engine\")\n",[22,1319,1320,1328,1353,1363],{"__ignoreMap":20},[211,1321,1322,1325],{"class":97,"line":213},[211,1323,1324],{"class":271},"try",[211,1326,1327],{"class":275},":\n",[211,1329,1330,1332,1334,1336,1338,1341,1343,1346,1349,1351],{"class":97,"line":230},[211,1331,380],{"class":342},[211,1333,789],{"class":275},[211,1335,314],{"class":220},[211,1337,317],{"class":275},[211,1339,1340],{"class":335},"engine",[211,1342,339],{"class":271},[211,1344,1345],{"class":220},"\"calamine\"",[211,1347,1348],{"class":275},").to_dict(",[211,1350,410],{"class":220},[211,1352,413],{"class":275},[211,1354,1355,1358,1361],{"class":97,"line":292},[211,1356,1357],{"class":271},"except",[211,1359,1360],{"class":342}," ImportError",[211,1362,1327],{"class":275},[211,1364,1365,1367,1369,1372],{"class":97,"line":299},[211,1366,380],{"class":342},[211,1368,886],{"class":275},[211,1370,1371],{"class":220},"\"pip install python-calamine to use this engine\"",[211,1373,363],{"class":275},[10,1375,1376],{},"calamine sees the same file, so the no-stylesheet case still gives serial numbers — switching engines hides the warning but not the underlying problem.",[199,1378,1380],{"id":1379},"step-5-report-it-upstream","Step 5 — Report it upstream",[10,1382,1383],{},"If the files come from a system your organisation runs, tell its owners. A minimal stylesheet is valid enough for Excel to open, which is why nobody on their side has noticed, but it costs every consumer a workaround — and the no-stylesheet variant silently strips date information that downstream reports depend on. A one-line bug report with the warning text and a sample file is usually enough.",[43,1385,52,1390,52,1393,52,1396,52,1399,52,1406,52,1414,52,1419,52,1423,52,1427,52,1430,52,1433,52,1440,52,1445,52,1450,52,1456,52,1461,52,1466,52,1469,52,1472,52,1476,52,1479,52,1482,52,1488,52,1493,52,1496,52,1499,52,1503,52,1506,52,1509,52,1513,52,1516,52,1519,52,1525,52,1529,52,1532,52,1536,52,1538,52,1541,52,1545,52,1548,52,1551,52,1558,52,1562],{"viewBox":1386,"role":46,"ariaLabelledBy":1387,"xmlns":50,"style":51},"4 0 752 308",[1388,1389],"nds-decide-t","nds-decide-d",[54,1391,1392],{"id":1388},"Handling a stylesheet warning in a job",[58,1394,1395],{"id":1389},"A decision chart. For \"no default style\" with correct data, filter that warning by message and module. For \"no stylesheet\", convert known date columns from serial numbers. For an intermediate file you control, load and save it with openpyxl to write a full stylesheet. For large batches that only need values, read with the calamine engine.",[62,1397],{"x":64,"y":65,"width":66,"height":1398,"fill":68},"308",[62,1400],{"x":1401,"y":72,"width":1402,"height":1403,"rx":1404,"fill":1405,"stroke":1166,"style":78},"239.5","280.9","75.5","12","#f0f4ff",[80,1407,1409],{"transform":1408},"translate(368.0,29.0) scale(1.000)",[84,1410],{"d":1411,"fill":87,"stroke":1412,"style":1413},"M11 4a7 7 0 1 0 .01 0z M16 16l5 5","var(--brand-strong,#4338ca)","stroke-width:1.80px;stroke-linecap:round;stroke-linejoin:round",[19,1415,1418],{"x":1416,"y":1403,"style":1417},"380.0","font-size:13.5px;font-weight:700;fill:var(--brand-strong,#4338ca);text-anchor:middle","Which warning, and whose file?",[97,1420],{"x1":1416,"y1":1421,"x2":1416,"y2":1422,"stroke":1166,"style":78},"91.5","111.5",[97,1424],{"x1":1425,"y1":1422,"x2":1426,"y2":1422,"stroke":1166,"style":78},"104.0","656.0",[97,1428],{"x1":1425,"y1":1422,"x2":1425,"y2":1429,"stroke":1166,"style":78},"157.5",[1168,1431],{"points":1432,"fill":1171},"104.0,161.5 99.0,152.5 109.0,152.5",[62,1434],{"x":1435,"y":1436,"width":1437,"height":1438,"rx":1439,"fill":68,"stroke":1022,"style":1179},"49.3","121.5","109.4","21.0","10",[19,1441,1444],{"x":1425,"y":1442,"style":1443},"136.0","font-size:11.5px;font-weight:700;fill:var(--muted,#5b6780);text-anchor:middle","no default style",[62,1446],{"x":71,"y":1447,"width":1448,"height":1449,"rx":1404,"fill":76,"stroke":77,"style":78},"163.5","168.0","128.0",[80,1451,1453],{"transform":1452},"translate(92.0,194.0) scale(1.000)",[84,1454],{"d":1455,"fill":87,"stroke":88,"style":1413},"M3 5h18l-7 8v6l-4 2v-8z",[19,1457,1460],{"x":1425,"y":1458,"style":1459},"240.5","font-size:13.5px;font-weight:700;fill:var(--teal-ink,#0b6157);text-anchor:middle","Filter it narrowly",[19,1462,1465],{"x":1425,"y":1463,"style":1464},"260.0","font-size:11.5px;font-weight:400;fill:var(--text,#172033);text-anchor:middle","by message and module",[97,1467],{"x1":1468,"y1":1422,"x2":1468,"y2":1429,"stroke":1166,"style":78},"288.0",[1168,1470],{"points":1471,"fill":1171},"288.0,161.5 283.0,152.5 293.0,152.5",[62,1473],{"x":1474,"y":1436,"width":1475,"height":1438,"rx":1439,"fill":68,"stroke":1022,"style":1179},"239.1","97.8",[19,1477,1478],{"x":1468,"y":1442,"style":1443},"no stylesheet",[62,1480],{"x":1481,"y":1447,"width":1448,"height":1449,"rx":1404,"fill":145,"stroke":146,"style":78},"204.0",[80,1483,1485],{"transform":1484},"translate(276.0,176.5) scale(1.000)",[84,1486],{"d":1487,"fill":87,"stroke":153,"style":1413},"M4 5h16v15H4z M4 10h16 M8 3v4 M16 3v4",[19,1489,1492],{"x":1468,"y":1490,"style":1491},"223.0","font-size:13.5px;font-weight:700;fill:var(--gold-ink,#7a4e06);text-anchor:middle","Convert date",[19,1494,1495],{"x":1468,"y":1458,"style":1491},"columns",[19,1497,1498],{"x":1468,"y":1463,"style":1464},"unit=\"D\", origin",[19,1500,1502],{"x":1468,"y":1501,"style":1464},"277.5","1899-12-30",[97,1504],{"x1":1505,"y1":1422,"x2":1505,"y2":1429,"stroke":1166,"style":78},"472.0",[1168,1507],{"points":1508,"fill":1171},"472.0,161.5 467.0,152.5 477.0,152.5",[62,1510],{"x":1511,"y":1436,"width":1512,"height":1438,"rx":1439,"fill":68,"stroke":1022,"style":1179},"396.5","151.1",[19,1514,1515],{"x":1505,"y":1442,"style":1443},"your own intermediate",[62,1517],{"x":1518,"y":1447,"width":1448,"height":1449,"rx":1404,"fill":1405,"stroke":1166,"style":78},"388.0",[80,1520,1522],{"transform":1521},"translate(460.0,185.2) scale(1.000)",[84,1523],{"d":1524,"fill":87,"stroke":1412,"style":1413},"M20 11a8 8 0 1 0-2.3 5.7 M20 4v7h-7",[19,1526,1528],{"x":1505,"y":1527,"style":1417},"231.8","Resave with",[19,1530,811],{"x":1505,"y":1531,"style":1417},"249.2",[19,1533,1535],{"x":1505,"y":1534,"style":1464},"268.8","writes a full stylesheet",[97,1537],{"x1":1426,"y1":1422,"x2":1426,"y2":1429,"stroke":1166,"style":78},[1168,1539],{"points":1540,"fill":1171},"656.0,161.5 651.0,152.5 661.0,152.5",[62,1542],{"x":1543,"y":1436,"width":1544,"height":1438,"rx":1439,"fill":68,"stroke":1022,"style":1179},"619.5","73.0",[19,1546,1547],{"x":1426,"y":1442,"style":1443},"big batch",[62,1549],{"x":1550,"y":1447,"width":1448,"height":1449,"rx":1404,"fill":1021,"stroke":1022,"style":78},"572.0",[80,1552,1554],{"transform":1553},"translate(644.0,194.0) scale(1.000)",[84,1555],{"d":1556,"fill":87,"stroke":1557,"style":1413},"M13 2L4 14h7l-1 8 9-12h-7z","var(--text,#172033)",[19,1559,1561],{"x":1426,"y":1458,"style":1560},"font-size:13.5px;font-weight:700;fill:var(--text,#172033);text-anchor:middle","Use calamine",[19,1563,1564],{"x":1426,"y":1463,"style":1464},"no warning and faster",[199,1566,1568],{"id":1567},"common-pitfalls","Common pitfalls",[1570,1571,1572,1582,1592,1598,1604],"ul",{},[1573,1574,1575,1581],"li",{},[1576,1577,1578,1580],"strong",{},[22,1579,718],{}," with no arguments."," It hides every warning in the process, including pandas deprecation notices and the no-stylesheet warning that signals lost dates.",[1573,1583,1584,1587,1588,1591],{},[1576,1585,1586],{},"Filtering on the wrong module."," The warning is raised inside openpyxl, not pandas; a filter with ",[22,1589,1590],{},"module=\"pandas\""," does nothing.",[1573,1593,1594,1597],{},[1576,1595,1596],{},"Converting every numeric column to dates."," Only columns known to be dates should be converted; the file gives no way to tell them apart.",[1573,1599,1600,1603],{},[1576,1601,1602],{},"Treating the warning as a sign of corruption."," It is not; the file opens in Excel and the values are correct. Do not route these files to a repair or quarantine path on the strength of the warning alone.",[1573,1605,1606,1609],{},[1576,1607,1608],{},"Assuming a resave restores formats."," It writes a valid stylesheet, but formats that were never in the file stay missing.",[199,1611,1613],{"id":1612},"performance-notes","Performance notes",[10,1615,1616],{},"The warning itself costs nothing measurable. In a job that reads thousands of such files, the cost is log noise — one line per file — which is reason enough to filter it. If the job is slow, the read is the bottleneck, not the warning; switching to calamine removes both.",[199,1618,1620],{"id":1619},"conclusion","Conclusion",[10,1622,1623,1624,1626],{},"\"Workbook contains no default style\" means the file's stylesheet lacks a Normal style; the data is intact and a filter on that message and module is the right response. \"Workbook contains no stylesheet\" means number formats are missing, so date columns arrive as serial numbers and must be converted with ",[22,1625,906],{}," and origin 1899-12-30. Resave intermediates you control with openpyxl, use calamine for fast value-only reads, and tell the producing system's owners.",[199,1628,1630],{"id":1629},"frequently-asked-questions","Frequently asked questions",[10,1632,1633,1636],{},[1576,1634,1635],{},"Is the \"no default style\" warning dangerous?","\nNo. The file's stylesheet is missing its Normal style entry, so openpyxl adds its own. Values, number formats and dates are read correctly. It is safe to silence it with a narrow filter.",[10,1638,1639,1642],{},[1576,1640,1641],{},"How is \"no stylesheet\" different?","\nThat warning means the file has no usable cell formats at all. openpyxl can then no longer tell which numbers are dates, so date columns arrive as serial numbers such as 46082. Convert those columns explicitly.",[10,1644,1645,1648],{},[1576,1646,1647],{},"Why does pandas show the warning?","\npandas uses openpyxl to read .xlsx files, and openpyxl raises the warning while loading the stylesheet. The warning comes from openpyxl's stylesheet module, which is why the filter must target that module.",[10,1650,1651,1654],{},[1576,1652,1653],{},"Can I fix the file itself?","\nYes. Loading it with openpyxl and saving it again writes a complete stylesheet, and the warning disappears for every later reader. Do this when the file is an intermediate you control, not when it is someone else's original.",[199,1656,1658],{"id":1657},"related","Related",[1570,1660,1661,1667,1674,1681],{},[1573,1662,1663,1664,1666],{},"Up one level: ",[37,1665,40],{"href":39}," — other warnings and errors on read.",[1573,1668,1669,1673],{},[37,1670,1672],{"href":1671},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-data-validation-extension-is-not-supported-warning\u002F","Fix the \"Data Validation extension is not supported\" Warning in openpyxl"," — another openpyxl load-time warning.",[1573,1675,1676,1680],{},[37,1677,1679],{"href":1678},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-dates-and-times-in-excel-data\u002Fparse-excel-dates-into-python-datetimes-with-pandas\u002F","Parse Excel Dates into Python datetimes with pandas"," — date handling in general.",[1573,1682,1683,1687],{},[37,1684,1686],{"href":1685},"\u002Fautomating-reporting-workflows\u002Ferror-handling-and-logging-in-excel-automation\u002Flog-python-excel-script-output-to-a-file\u002F","Log Python Excel Script Output to a File"," — keeping warnings in the job log where they can be reviewed.",[1689,1690,1691],"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 pre.shiki code .s-wDw, html code.shiki .s-wDw{--shiki-default:#6A737D;--shiki-dark:#BDC4CC}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 .sa561, html code.shiki .sa561{--shiki-default:#E36209;--shiki-dark:#FFB757}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}",{"title":20,"searchDepth":230,"depth":230,"links":1693},[1694,1695,1696,1697,1698,1699,1700,1701,1702,1703,1704,1705],{"id":201,"depth":230,"text":202},{"id":255,"depth":230,"text":256},{"id":436,"depth":230,"text":437},{"id":711,"depth":230,"text":712},{"id":895,"depth":230,"text":896},{"id":1188,"depth":230,"text":1189},{"id":1379,"depth":230,"text":1380},{"id":1567,"depth":230,"text":1568},{"id":1612,"depth":230,"text":1613},{"id":1619,"depth":230,"text":1620},{"id":1629,"depth":230,"text":1630},{"id":1657,"depth":230,"text":1658},"2026-09-25","openpyxl warns \"Workbook contains no default style, apply openpyxl's default\" when a file's stylesheet lacks a Normal style. The data is fine — but the related \"no stylesheet\" warning can turn dates into numbers. Tell them apart, silence the harmless one precisely and repair the files.","md",[1710,1712,1714,1716],{"q":1635,"a":1711},"No. The file's stylesheet is missing its Normal style entry, so openpyxl adds its own. Values, number formats and dates are read correctly. It is safe to silence it with a narrow filter.",{"q":1641,"a":1713},"That warning means the file has no usable cell formats at all. openpyxl can then no longer tell which numbers are dates, so date columns arrive as serial numbers such as 46082. Convert those columns explicitly.",{"q":1647,"a":1715},"pandas uses openpyxl to read .xlsx files, and openpyxl raises the warning while loading the stylesheet. The warning comes from openpyxl's stylesheet module, which is why the filter must target that module.",{"q":1653,"a":1717},"Yes. Loading it with openpyxl and saving it again writes a complete stylesheet, and the warning disappears for every later reader. Do this when the file is an intermediate you control, not when it is someone else's original.","fix workbook contains no default style warning in openpyxl",null,{"breadcrumb":1721},[1722,1725,1728],{"name":1723,"item":1724},"Home","\u002F",{"name":1726,"item":1727},"Getting Started with Python Excel Automation","\u002Fgetting-started-with-python-excel-automation\u002F",{"name":40,"item":39},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-workbook-contains-no-default-style-warning",{"title":1731,"description":1732},"Fix UserWarning: Workbook contains no default style, apply openpyxl's default","What openpyxl's 'no default style' and 'no stylesheet' warnings mean, when dates come back as serial numbers, and how to silence, repair or avoid the warning in pandas read_excel.","fix-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",[1736,1737,811],"troubleshooting","reading-excel","how-to","OfgejT-ssHMGORJvHBqhxYsHunhifGM3JnE69Dr6o84",[1741,1745],{"title":1742,"path":1743,"stem":1744,"children":-1},"Fix the win32com gen_py AttributeError (CLSIDToClassMap)","\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-win32com-gen-py-attributeerror","getting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-win32com-gen-py-attributeerror\u002Findex",{"title":1746,"path":1747,"stem":1748,"children":-1},"Fix \"Worksheet Does Not Exist\" KeyError in openpyxl","\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-worksheet-does-not-exist-keyerror-in-openpyxl","getting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-worksheet-does-not-exist-keyerror-in-openpyxl\u002Findex",[1750,1752],{"path":1751,"title":1726},"\u002Fgetting-started-with-python-excel-automation",{"path":1753,"title":40},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors",[],[1756,1760,1763,1765,1768,1771],{"path":1757,"title":1758,"kind":1759},"\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":1761,"title":1762,"kind":1738},"\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":1764,"title":995,"kind":1759},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-dates-and-times-in-excel-data\u002Ffix-excel-serial-numbers-showing-instead-of-dates",{"path":1766,"title":1767,"kind":1738},"\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":1769,"title":1770,"kind":1738},"\u002Fautomating-reporting-workflows\u002Fautomating-excel-online-with-microsoft-graph\u002Fhandle-microsoft-graph-throttling-for-excel","Handle Microsoft Graph Throttling in Excel Automation",{"path":1772,"title":1773,"kind":1774},"\u002Fautomating-reporting-workflows\u002Ferror-handling-and-logging-in-excel-automation","Error Handling and Logging in Excel Automation","guide",1790972067685]