232showtime Posted April 9, 2015 Posted April 9, 2015 (edited) how to read single active cell, like for example ;; i will click on B33 or I will move the selection from B40 to B33 using arrow keys then do my script $ClickedCell = "" HotKeySet("{F1}", "Read") Func Read() Local $sText = WinGetTitle("[CLASS:XLMAIN]") $iText = StringLeft($sText, 5) Local $sWorkbook = $iText & ".xlsx" $oWorkbook = _Excel_BookAttach($sWorkbook, "filename") Local $sResult = _Excel_RangeRead($oWorkbook, Default, $ClickedCell) MsgBox(0, "Excel", $sResult) EndFunc how will i get the data from $ClickedCell ??? except for ctrl+v Edited April 9, 2015 by 232showtime ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon.
Solution water Posted April 9, 2015 Solution Posted April 9, 2015 I do not see _Excel_Open in your code. To get the active cell you would use $oExcel.ActiveCell. $oExcel is the application object as returned by _Excel_Open. 232showtime 1 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
232showtime Posted April 9, 2015 Author Posted April 9, 2015 book1.xlsx is already open and i used book attach to get application obj. could you give me example about $oExcel.ActiveCell its kinda new to me dont know where to start.. pleaaaaaasssseeee o:) ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon.
water Posted April 9, 2015 Posted April 9, 2015 $oExcel.ActiveCell gives you the active cell of the active sheet in the active workbook. Means: The cell the user selected by clicking on it. 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
232showtime Posted April 12, 2015 Author Posted April 12, 2015 (edited) got it... found and modified some examples here in forum but how to remove the $ sign??? Global $CellNo HotKeySet("{F1}", "Read") $oExcel = ObjGet("", "Excel.Application") While 1 Sleep(100) WEnd Func Read() $active = $oExcel.ActiveCell.Address If $CellNo <> $active Then $CellNo = $active MsgBox(0, "Success", "Range is : " & $active ) EndIf EndFunc ;==>Read Edited April 12, 2015 by 232showtime ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon.
water Posted April 12, 2015 Posted April 12, 2015 Which $ sign? 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
232showtime Posted April 12, 2015 Author Posted April 12, 2015 (edited) if you run my script message box will pop out and will say, Range is : $A$232.... $ sign in message box output... I want to get only the text, like, Range is : A232 Edited April 12, 2015 by 232showtime ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon.
water Posted April 12, 2015 Posted April 12, 2015 That's an absolute cell reference. Please have a look at function _Excel_ConvertFormula to convert it to a relative reference. 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