I have a script below.
The idea is a matching PDF file is opened if it contains the same number from range A2:A3
The 2nd part of the script where I am stuck. There is supposed to be a ctrl f search in the file for a serial no which is from D2:D3
The problem is when it comes to pasting this range D2:D3 into the ctrl f search bar, it pastes all the serial numbers in the range.
I only want it to paste the serial number in cell D2 rather than pasting both D2 and D3 serial numbers. Then the script would loop back to open the pdf matching A3 and repeat the action by pasting D3
Is there a way to paste each cell in the D-range one at a time?
Code: Select all
file2open := "C:\test\test excel data.xlsx"
XL := ComObjCreate( "Excel.Application" )
XL.Workbooks.Open(file2open)
for Cell in XL.ActiveSheet.range("A2:A3")
{
run, % "C:\test\" . Cell.Value . " Customer Complaint Report.pdf"
sleep, 3000
Send ^{f}
sleep, 1000
{
for Cell in XL.ActiveSheet.range("D2:D3")
Paste(Cell.Value) ;this is where I am stuck, I dont want all of the values from range D2:D3 to be pasted
sleep, 1000
Sendinput, {Enter}
sleep, 1000
Sendinput, {Enter}
sleep, 5000
}
}
return
Esc::ExitApp ; Exit script with Escape key
Paste(text) {
Clipboard := text
Send, {Control down}v{Control up}
sleep, 500
}
J