Avatar of spitcha
spitcha
 asked on

Excel .end(xlUp) fails

The sub writes messages in Outlook to an Excel file. I need the script to select to lastRow in the excel file but the line "rInt = xlWks.Range("A65536").End(xlUp).Row" errors.
ol-xl-error.txt
OutlookMicrosoft Excel

Avatar of undefined
Last Comment
spitcha

8/22/2022 - Mon
nutsch

dim rInt as a long instead, you probably have more than the 32 some thousands supported by the integer data type.
spitcha

ASKER
Thanks for the reply. I get the same error after changing rInt to long
Flyster

See if this will work:

rInt = .Cells(.Rows.Count, "A").End(xlUp).Row

Flyster
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
spitcha

ASKER
Nope. Still getting the same error.
spitcha

ASKER
The issue is with end(xlUp). I'm able to select or get any value, leaving this query out.
ASKER CERTIFIED SOLUTION
Norie

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
spitcha

ASKER
Adding this line fixed the issue.
Thanks much!
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.