Mosses Posted February 26, 2016 Posted February 26, 2016 Hi I am Mosses I am new to AutoIt scripting... I want to copy or read data from one windows application and paste or export the value to excel. Can anyone help me with this
Juvigy Posted February 26, 2016 Posted February 26, 2016 Welcome to the forum. I can point you to the right direction. Check the help file - there are a lot of examples there. For excel you will need to check the _Excel UDF and functions. For the other part - it depends of the windows application. You will have to give more details.
Mosses Posted February 29, 2016 Author Posted February 29, 2016 Thank you Juvigy.... It was helpful for me
Mosses Posted February 29, 2016 Author Posted February 29, 2016 (edited) Hi can I assign send("^c") and send("^v") to a variable...??? Below is my code I am assigning to a variable but I am getting value "1" Local $dtValue = send("^v") Is this the right or correct way of doing can anyone help me on this.. Thanks in advace... Edited February 29, 2016 by Mosses
InunoTaishou Posted February 29, 2016 Posted February 29, 2016 Calling the function Send just returns true. You can assign the function call Send to a variable but you need to supply the parameters, or you can create a wrapper that does Send("^c or v") and assign that function call to a variable. Global $send = Send Global $send_ctrl_v = SendCtrlV GLobal $send_ctrl_c = SendCtrlC $send("^c") $send("^v") $send_ctrl_c() $send_ctrl_v() Func SendCtrlV() ConsoleWrite("SendCtrlV() Called" & @LF) Send("^v") EndFunc Func SendCtrlC() ConsoleWrite("SendCtrlC() Called" & @LF) Send("^c") EndFunc Why do you want to use Send? There may be a more efficient way to do what you want without using Send. Good rule of thumb, if you can avoid using Send and MouseClick/MouseMove, do it.
Mosses Posted February 29, 2016 Author Posted February 29, 2016 Thanks for your quick reply Inuno Taishou.. I will try this...
Mosses Posted February 29, 2016 Author Posted February 29, 2016 Hi Inuno Taishou... I tried the above provided script.. I am still getting Boolean value... Thanks
InunoTaishou Posted February 29, 2016 Posted February 29, 2016 What version of autoit are you using? That script executes and calls the corresponding functions and writes the call to the console for me
Mosses Posted February 29, 2016 Author Posted February 29, 2016 I am using version 3.5.4 What I want to do is copy few data from an Windows Tool and paste it in a new excel....
InunoTaishou Posted February 29, 2016 Posted February 29, 2016 What about using the _Excel_RangeCopyPaste UDF instead?
Mosses Posted February 29, 2016 Author Posted February 29, 2016 1 minute ago, InunoTaishou said: What about using the _Excel_RangeCopyPaste UDF instead? Thanks I will try with that
Mosses Posted February 29, 2016 Author Posted February 29, 2016 Hi inuno I guess _Excel_RangeCopyPaste UDF is used to copy and paste from Excel... But in my case I copy from an 3rd party tool and paste it to an excel... Thanks
water Posted February 29, 2016 Posted February 29, 2016 (edited) Use ClipGet to retrieve text from the clipboard into a variable and then _Excel_RangeWrite to write the data to Excel. If you need to copy formatted data then use _Excel_RangeCopyPaste to write data from the clipboard to Excel (see example 3 in the help file). Edited February 29, 2016 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Mosses Posted February 29, 2016 Author Posted February 29, 2016 Hi Water Thanks a lots its working for me with ClipGet..... Thank you again
water Posted February 29, 2016 Posted February 29, 2016 Glad to be of service My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Mosses Posted February 29, 2016 Author Posted February 29, 2016 Hi how to find the last row in excel...???
water Posted February 29, 2016 Posted February 29, 2016 Please have a look at the wiki. $oRange = $oWorkbook.ActiveSheet.UsedRange.SpecialCells($xlCellTypeLastCell).Row Returns the number of the last used row. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Juvigy Posted February 29, 2016 Posted February 29, 2016 $oExcel.ActiveSheet.UsedRange.Columns.Count $oExcel.ActiveSheet.UsedRange.Rows.Count
water Posted February 29, 2016 Posted February 29, 2016 (edited) NB: The result of this two statements is only true when the used range starts at cell A1. If the first touched cell is on another cell then the result might be misleading as UsedRange only puts the touched cells into account. For details please see the wiki as mentioned above. Edited February 29, 2016 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now