win32com

Python: Insert object into excel in a specific row and column with win32com

99封情书 提交于 2020-12-13 05:10:06
问题 I'm using Python 3.5 and win32com to insert an object (.pdf file) into excel with the following method: Embedded_object.Add(ClassType=None, Filename=file_loction, Link=False, DisplayAsIcon=True, Left=3, Top=0, Width=50, Height=50) This works fine, however it always embeds the object in the A1 cell, is there a way to embed the object into a specific row and column using the above method? Edit: I also tried the following: worksheet.Range('A1:A1').Copy() worksheet.Paste(Destination=worksheet

difference between pywintypes and pythoncom for com_error

谁都会走 提交于 2020-07-22 05:21:50
问题 What is the difference between pywintypes and pythoncom? I am really new to COM handling using python so a simplified description will be helpful. also I am using a com wrapper to fixed the com error "call is rejected by callee". however the com error is not capture by the exception. so should I be importing com_error from pywintypes or pythoncom? from pywintypes import com_error import win32com.client class ComWrapper: @staticmethod def wrap(func, *func_args): try: print('running the