Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | 31 |
Tags
- 다이어트
- 리눅스
- javascript
- ASP
- PyQt
- urllib
- 날짜
- tensorflow
- port
- flutter
- 유니티
- 맛집
- Unity
- PER
- Excel
- Linux
- sqlite
- python
- 라즈베리파이
- pandas
- 함수
- ubuntu
- PyQt5
- MS-SQL
- node.js
- IOS
- swift
- MySQL
- GIT
- mssql
Archives
아미(아름다운미소)
암호화엑셀을 CSV로 변경 본문
import win32com.client as win32
import os
excel = win32.Dispatch("Excel.Application")
excel.Visible = False
excel.DisplayAlerts = False
folder = r"C:\excel_folder"
try:
for file in os.listdir(folder):
if file.endswith(".xlsx"):
xlsx = os.path.join(folder, file)
wb = excel.Workbooks.Open(xlsx)
for sheet in wb.Worksheets:
csv = os.path.join(
folder,
f"{file.replace('.xlsx','')}_{sheet.Name}.csv"
)
sheet.SaveAs(csv, FileFormat=62)
wb.Close(False)
finally:
excel.Quit() # ⭐ 에러 나도 엑셀 강제 종료
Comments