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?
#1
Similar to Excel VBA, win32com has a 'xlUp' command. But do I use it? I tried the below code but get
AttributeError: xlUp

Or how do I find all the methods available in a Python library? Thanks in advance!

import win32com.client as wc

xl=wc.DispatchEx("Excel.Application")
wb=xl.Workbooks.Open(Filename='TEST', ReadOnly=False, UpdateLinks=0, IgnoreReadOnlyRecommended=True)
ws=wb.Worksheets('sht1')

print(ws.cells(ws.rows.count, 1).End(wc.constants.xlUp).Address)
Reply


Messages In This Thread
win32com — How to resolve “AttributeError: xlUp” for Excel files? - by JaneTan - Aug-18-2021, 01:16 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 471 Feb-07-2024, 12:24 PM
Last Post: Viento
  [split] How to resolve version conflicts in Python? atonalwilson 1 1,014 May-04-2023, 09:02 AM
Last Post: buran
  How to resolve version conflicts in Python? taeefnajib 0 941 Apr-27-2023, 08:37 PM
Last Post: taeefnajib
  How to loop through all excel files and sheets in folder jadelola 1 4,552 Dec-01-2022, 06:12 PM
Last Post: deanhystad
  Creating csv files from Excel file azizrasul 40 5,856 Nov-03-2022, 08:33 PM
Last Post: azizrasul
  How to resolve my problem in Pycharm? bshoushtarian 0 871 Sep-26-2022, 11:45 AM
Last Post: bshoushtarian
  Solving equation equal to zero: How to resolve the syntax error? alexfrol86 3 2,001 Feb-21-2022, 08:58 AM
Last Post: deanhystad
  Working with excel files arsouzaesilva 6 3,222 Sep-17-2021, 06:52 PM
Last Post: arsouzaesilva
Exclamation win32com: How to pass a reference object into a COM server class Alfalfa 3 4,927 Jul-26-2021, 06:25 PM
Last Post: Alfalfa
  How to resolve Index Error in my code? codify110 6 3,070 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