Advertisement
tabnation

excel 1

Feb 26th, 2021
468
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. f9::
  2. FilePath = X:\Desktop\ppl.xlsx"
  3. oWorkbook := ComObjCreate("Excel.Application")
  4. oWorkbook.Workbooks.open(FilePath,, readonly := true)
  5. oWorkbook.Visible := 0
  6. clientsname := oWorkbook.Worksheets("test doc").Range("A3").Value
  7. StringRight, clientsname, clientsname, 5
  8. clientsphone := oWorkbook.Worksheets("test doc").Range("B3").Value
  9. clientsstate := oWorkbook.Worksheets("test doc").Range("C3").Value
  10. clientsfax := oWorkbook.Worksheets("test doc").Range("D3").Value
  11. Xl.Quit()
  12.  
  13. finalinfo=
  14. (
  15. load completed
  16. Clients name is %clientsname%
  17. Clients phone is %clientsphone%
  18. Clients state is %clientsstate%
  19. Clients fax is %clientsfax%
  20. )
  21. msgbox, %finalinfo%
  22. return
  23.  
  24. f10::
  25. vararr=0
  26. {
  27. xcl := ComObjActive("Excel.Application")
  28. reminderList := []
  29. loop
  30. {
  31. bodyText := xcl.Range("A" . A_Index + 1).value
  32. vararr++
  33. varsavedname%vararr%=%bodyText%
  34. if (bodyText = "")
  35. break
  36. }
  37. Msgbox, Load completed row 4 info is %varsavedname3% ---- Final row is %vararr%
  38. }
  39. Return
  40.  
  41. f11::
  42. {
  43. vararr=0
  44. xcl := ComObjActive("Excel.Application")
  45. reminderList := []
  46. loop
  47. {
  48. bodyText := xcl.Range("A" . A_Index + 1).value
  49. vararr++
  50. varsavedname%vararr%=%bodyText%
  51. if (bodyText = "12345 Thom")
  52. break
  53. }
  54.  
  55. oWorkbook := ComObjCreate("Excel.Application")
  56. oWorkbook.Workbooks.open(FilePath,, readonly := true)
  57. oWorkbook.Visible := 0
  58. Xl.Quit()
  59.  
  60. vararr++
  61. Msgbox, Thom found at line %vararr%
  62. }
  63. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement