I've been developing a script to save a range of values (not all numerical) and for a long time have been copying the contents of the cell, using (stringtrimright, clipboard, clipboard, 2) and (Variable=%clipboard%) to save it as a variable and then moving to the next. I have found however that this is limiting my speed in segments such as this:
Code: Select all
Send, {right}{ctrl down}c{ctrl up}
StringTrimRight, clipboard, clipboard, 2
JProdPro=%clipboard%{space}
If JProdPro={space}
JProdPro=
Send, {right}{ctrl down}c{ctrl up}
StringTrimRight, clipboard, clipboard, 2
JMat=%clipboard%{space}
If JMat={space}
JMat=
Send, {right}{ctrl down}c{ctrl up}
StringTrimRight, clipboard, clipboard, 2
JComm=%clipboard%{space}
If JComm={space}
JComm=
Send, {right 4}{ctrl down}c{ctrl up}
StringTrimRight, clipboard, clipboard, 2
JDesc=%clipboard%,{space}
Essentially it often results in clipboard errors on excel due to multiple cells being copied in quick succession. I have been looking into using COM to get around this as not only will it save time due to skipping some send inputs, it will also prevent the clipboard bottleneck from slowing the script in general. So far I have:
Code: Select all
xl := ComObjActive("Excel.Application")
data := xl.ActiveCell.Value
This works great on cells only containing numbers, allowing me to instantly save the cell contents as a variable, however cells that contain any letters will have their variable saved as 0.
Is there a workaround to either of these options to save the contents of an excel cell (or perhaps another way around it that I haven't yet encountered)?