Avatar of wzm
wzm
 asked on

LotusScript - Excel Range

Hi,

Error:"Object not found ..."
Reasons:When excel column reach "AB" chr(i) no longer working
Question:Any workaround/fix ?

i=97
For x = Lbound(ArrName) To Ubound(ArrName)
 i = i + 1            
 ctr = ctr + 1                  
 xlSheet.Range(Trim(Chr(i)) & Cstr(ctr)).Value = ArrName(x)
..


Lotus IBM

Avatar of undefined
Last Comment
olaraak

8/22/2022 - Mon
olaraak

Alphabet:
A=Chr(65)...Z=Chr(90)

How you want to fill your sheet?
Usually it is filled by column like this:

rem  if we use only column A, 
rem  then i=65
rem  file = excel file object
 
rownumber = 1
 
For x = Lbound(ArrName) To Ubound(ArrName) 
  
   cellname$ = chr(i) & cstr(rownumber)
   file.range( cellname$ ).Select
   file.Activecell.FormulaR1C1 = ArrName(x)
   rownumber = rownumber + 1
 
End For
 
rem If you need to change column, then substitute needed number for i

Open in new window

wzm

ASKER
abt 250 columns (depends of array) with at least 10 rows each.
olaraak

Then add column loop and row loop.

Or, swap columns and rows, if its possible.

Your help has saved me hundreds of hours of internet surfing.
fblack61
wzm

ASKER
chr(i) is from A to Z, but when it reach colums AA,AB... that caused the problem
ASKER CERTIFIED SOLUTION
olaraak

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.