使用 python 代码自动化 SAP analsys excel 文件

问题描述 投票:0回答:0

我想编写自动刷新的代码。

我能够得到如下代码。

[CODE]

import win32com.client
import os
import pywintypes
import win32com.client as win32
from pyrfc import Connection

folder_path = "......"
# Open the Excel application`your text`
excel = win32com.client.Dispatch("Excel.Application")

# Loop over all Excel files in the folder
for filename in os.listdir(folder_path):
    if filename.endswith(".xlsx") or filename.endswith(".xls"):
        # Open the workbook and refresh the data connections
        workbook_path = os.path.join(folder_path, filename)
        workbook = excel.Workbooks.Open(workbook_path)
        for conn in workbook.Connections:
            conn.Refresh()
        workbook.Save()
        workbook.Close()

允许刷新excel数据,但不能用于SAP分析刷新。

我如何不仅修改“excel refresh”而且修改 SAPExecuteCommand”、“Refresh”??

floder_path 有几个链接 SAP 分析 excel 的 excel 文件。

我试过修改这段代码,但一直报错

python automation sap
© www.soinside.com 2019 - 2024. All rights reserved.