#■■■■■ 複数のEXCELファイルをPDFで出力する
#出典: https://umano-ie.com/programming09/


import glob, xlwings as xw

excel_files = glob.glob("C:/Users/shienkikou11/Desktop/test/*.xlsx") #excelファイルをすべて取得
savefile_path = "C:/Users/shienkikou11/Desktop/" #出力先のパスを設定

App = xw.App() #単一のアプリ実行環境管理

#ExcelファイルをPDFファイルに変換
for i in excel_files:
    print(i)
    filename = i.replace(".xlsx", ".pdf")
    wb = xw.Book(i)
    wb.to_pdf(path= savefile_path + filename, include=None, exclude=None, exclude_start_string='#', show=False)
    wb.close()

App.quit() #アプリ実行環境を終了