here is my code:
#E:: ;;;;HOTKEY is window key and the E key
#Persistent ;;;;leave HOTKEY available and running. The ExitApp would kill the HOTKEY
FormatTime, Time, ,M/dd/yyyy h:mmtt ;;;add this for time stamp but need it to append to pasted comment
TryAgain:
InputBox, PRO, PRO Number, Please enter PRO number.
If ErrorLevel || !PRO ;;;;If the user presses Cancel or enters nothing in the box
Return
Path := "C:\Documents and Settings\xxx1234\My Documents\testcsv.xlsx" ;;;Document getting information from
;;;MsgBox, 262148, Get Information, Open File TESTCSV.XLSX ;;;uncomment to create pop-up
;;;IfMsgBox No ;;uncomment if MsgBox is uncommented for pop-up
;;;Return ;;leaves HOTKEY running and allows user to repeat process/use ExitApp to end Hotkey function
xl := ComObjCreate("Excel.Application")
Workbook := xl.Workbooks.Open(Path)
;;;;;;;;;;;;;;;;;;matches the entire cell to the entrire string;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
If r := Workbook.ActiveSheet.Columns("A").Find[PRO,ComObjMissing(),ComObjMissing(),1].Row
{
;;;MsgBox, 262148, Copy, Comments for selected PRO # copied to Clipboard? ;;;uncomment to create pop-up
;;;IfMsgBox Yes ;;;uncomment if MsgBox is uncommented for pop-up
Clipboard := ;;;empties Clipboard
Workbook.ActiveSheet.Range["B" r].Copy() ;;;copies what corresponds in column B
Send, "^v%time%" ;;;(ctrl'v') auto copy where cursor is & adds date/time stamp
Return ;;leaves HOTKEY running and allows user to repeat process/use ExitApp to end Hotkey function
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;**NOTE - If they are not in a screen, they can go to screen and hit ctrl+v;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
}
else
{
MsgBox, 48, Warning, PRO number not found.
Workbook.Close(false), xl.Quit()
Goto TryAgain
;Return ;;leaves HOTKEY running and allows user to repeat process/use ExitApp to end Hotkey function
}
Return
Question on this is: Seems to all work correctly, except that after you run it through and test everything, and close the place where you are actually "pasting" the copied information (I was copying to another excel sheet); If you then double click any excel file, the "Path" file pops up along with the excel file you are opening. "Path" file is still hung up in a 'Read Only' state for awhile.
It eventually clears up and stops doing it, but how do you stop this from happening. You would think once you have successfully copied the cell information that the "Path" file would be free and this wouldn't happen.
Thoughts?
**Still accepting ideas or whatever on my picture goal.....