Python Forum
win32com — How to resolve “AttributeError: xlUp” for Excel files?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
win32com — How to resolve “AttributeError: xlUp” for Excel files?
#3
(Aug-18-2021, 01:16 AM)JaneTan Wrote: Or how do I find all the methods available in a Python library?
>>> import win32com.client as wc
>>> 
>>> dir(wc)
['CDispatch',
 'CLSIDToClass',
 'CastTo',
 'CoClassBaseClass',
 'Constants',
 'Dispatch',
 'DispatchBaseClass',
 'DispatchEx',
 'DispatchWithEvents',
 'EventsProxy',
 'GetActiveObject',
 'GetObject',
 'Moniker',
 'Record',
 'VARIANT',
 'WithEvents',
 '_PyIDispatchType',
 '__WrapDispatch',
 '__builtins__',
 '__cached__',
 '__doc__',
 '__file__',
 '__loader__',
 '__name__',
 '__package__',
 '__path__',
 '__spec__',
 '_event_setattr_',
 '_get_good_object_',
 '_get_good_single_object_',
 'build',
 'constants',
 'dynamic',
 'gencache',
 'getevents',
 'pythoncom',
 'pywintypes',
 'sys']
>>> 
>>> dir(wc.constants)
['__class__',
 '__delattr__',
 '__dict__',
 '__dicts__',
 '__dir__',
 '__doc__',
 '__eq__',
 '__format__',
 '__ge__',
 '__getattr__',
 '__getattribute__',
 '__gt__',
 '__hash__',
 '__init__',
 '__init_subclass__',
 '__le__',
 '__lt__',
 '__module__',
 '__ne__',
 '__new__',
 '__reduce__',
 '__reduce_ex__',
 '__repr__',
 '__setattr__',
 '__sizeof__',
 '__str__',
 '__subclasshook__',
 '__weakref__']
>>> 
>>> help(wc.constants)
Help on Constants in module win32com.client object:

class Constants(builtins.object)
 |  A container for generated COM constants.
 |  
 |  Methods defined here:
 |  
 |  __getattr__(self, a)
 |  
 |  __init__(self)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |  
 |  __dict__
 |      dictionary for instance variables (if defined)
 |  
 |  __weakref__
 |      list of weak references to the object (if defined)
Using a good Editor(eg VS Code) or REPL function/method(with help) will automatic show when type wc.
Reply


Messages In This Thread
RE: win32com — How to resolve “AttributeError: xlUp” for Excel files? - by snippsat - Aug-18-2021, 05:27 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Copy Paste excel files based on the first letters of the file name Viento 2 1,590 Feb-07-2024, 12:24 PM
Last Post: Viento
  [split] How to resolve version conflicts in Python? atonalwilson 1 1,674 May-04-2023, 09:02 AM
Last Post: buran
  How to resolve version conflicts in Python? taeefnajib 0 2,108 Apr-27-2023, 08:37 PM
Last Post: taeefnajib
  How to loop through all excel files and sheets in folder jadelola 1 9,285 Dec-01-2022, 06:12 PM
Last Post: deanhystad
  Creating csv files from Excel file azizrasul 40 12,268 Nov-03-2022, 08:33 PM
Last Post: azizrasul
  How to resolve my problem in Pycharm? bshoushtarian 0 1,416 Sep-26-2022, 11:45 AM
Last Post: bshoushtarian
  Solving equation equal to zero: How to resolve the syntax error? alexfrol86 3 3,034 Feb-21-2022, 08:58 AM
Last Post: deanhystad
  Working with excel files arsouzaesilva 6 4,597 Sep-17-2021, 06:52 PM
Last Post: arsouzaesilva
Exclamation win32com: How to pass a reference object into a COM server class Alfalfa 3 6,740 Jul-26-2021, 06:25 PM
Last Post: Alfalfa
  How to resolve Index Error in my code? codify110 6 4,322 May-22-2021, 11:04 AM
Last Post: supuflounder

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020