DineshPawar Posted July 6, 2017 Posted July 6, 2017 (edited) Hello, I am new for AutoIT, I need to automate some software , The input is given in Excel format with applied formula. in my case I need to Read only value of cell which come after applying the formula. But when I am read Excel cell from AutoIT, It read Formula than actual value , So how can read cell value. Any help I appreciate.(Sorry if I did any mistake in this question.) Edited July 6, 2017 by DineshPawar
Moderators JLogan3o13 Posted July 6, 2017 Moderators Posted July 6, 2017 @DineshPawar you say you're getting formula instead of value, which means you already have some code. Please post it so we can see what you're doing, rather than making us guess. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
DineshPawar Posted July 6, 2017 Author Posted July 6, 2017 @JLogan3o13, Thanks for reply , please find attached copy of Excel file and script file. _Excel2.xlsx Script.txt
Moderators JLogan3o13 Posted July 6, 2017 Moderators Posted July 6, 2017 Well, you have the last parameter set to 2, which returns the formula - not sure what you expect to get? If you want value, change that parameter to 1 as the help file shows. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
DineshPawar Posted July 6, 2017 Author Posted July 6, 2017 (edited) @JLogan3o13 if I change last parameter to 1 then it read cell ("A2"). and it fine with that cell because it not contain any formula. But when I read cell("A3") then it read formula, beacuse cell A3 contain formula. Edited July 6, 2017 by DineshPawar
water Posted July 6, 2017 Posted July 6, 2017 I get all the expected results: #include <Array.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> ; Create application object and open an example workbook Local $oExcel = _Excel_Open() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oWorkbook = _Excel_BookOpen($oExcel, @ScriptDir & "\_Excel2.xlsx") If @error Then MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example", "Error opening workbook '" & @ScriptDir & "\Extras\_Excel2.xlsx'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oExcel) Exit EndIf ; ***************************************************************************** ; Read the formulas of a cell range (all used cells in column A) ; ***************************************************************************** Local $aResult = _Excel_RangeRead($oWorkbook, Default, $oWorkbook.ActiveSheet.Usedrange.Columns("A:A"), 1) _ArrayDisplay($aResult) Local $aResult = _Excel_RangeRead($oWorkbook, Default, $oWorkbook.ActiveSheet.Usedrange.Columns("A:A"), 2) _ArrayDisplay($aResult) 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
DineshPawar Posted July 6, 2017 Author Posted July 6, 2017 @JLogan3o13 and @water , thank for your help, I really appreciate you. That s solve my problem
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