Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
load text from excel
#1
HI, I want to create a macro in which I want to record few clicks and then load text as keyboard input in some window from each cell from column of excel on every repetition of this this macro.
how to load text from next cell from column each time macro is repeated?
plz help me to proceed
#2
tried loading excel and pasting text but getting this error: class ExcelSheet Excel.Worksheet'ws : ExcelRange ExcelRow ExcelColumn FE_ExcelSheet_Row __ExcelState

Code:
Copy      Help
int w1=act(win("Downloads" "CabinetWClass"))
lef 296 162 w1 1 ;;tool bar 'Address: Downloads'
run "C:\Users\abhishek\Document\gmail.xlsx"
int hwndExcel=wait(30 WA "gmail")
ExcelSheet es.Init
str cell=es.Cell("A2")
paste cell
#endregion
#3
It is information, not error.

Instead of
str cell=es.Cell("A2"); paste cell
cell=es.Cell("A3"); paste cell
cell=es.Cell("A4"); paste cell
...

you can use array:
Macro Macro2764
Code:
Copy      Help
ExcelSheet es.Init
ARRAY(str) a; int i
es.CellsToArray(a "A:A")
for i 0 a.len
,paste a[0 i]
,key Y


Forum Jump:


Users browsing this thread: 1 Guest(s)