Taral Mehta
Taral Mehta

Reputation: 31

com_error: (-2147352567, 'exception occurred.', (0, none, none, none, 0, -2147352565), none)

com_error: (-2147352567, 'exception occurred.', (0, none, none, none, 0, -2147352565), none)

how to solve this error? we are using excel protected file and trying to connect with dataframe in pandas python

import pandas as pd
import xlwings as xw
import time
PATH = r"C:\Users\Shaileshbhai\Desktop\Lakhan\dummy.xlsx"
wb = xw.Book(PATH)
sheet = wb.sheets["Sheet1"]

df1 = sheet.used_range.options(pd.DataFrame, index=False, header=True).value
df1

def timer():
    time.sleep(5)
    df1 = sheet.used_range.options(pd.DataFrame, index=False, header=True).value
    print(df1)
    print("****************")
    timer()
timer()

Upvotes: 3

Views: 2809

Answers (0)

Related Questions