MateusAMOK Posted February 21, 2022 Share Posted February 21, 2022 When using _Excel_RangeRead, the script copies only some cells. Here's an example below: In the demo, the fetched behavior of the script is: Copy cell from one line, write to a text file; Go back to worksheet, copy cell from next row, write to text file (So, successively) However, as shown, there are some fields that are not copied. What makes this happen? Link to comment Share on other sites More sharing options...
Nine Posted February 21, 2022 Share Posted February 21, 2022 Show your script using post code method. Add also your xls file, so we can test. Make your script runable to us and eliminate all not related lines. Thanks. MateusAMOK and Danp2 2 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
water Posted February 21, 2022 Share Posted February 21, 2022 Can you please post the exact _Excel_RangeRead statement you use? Can you please post the value of @error and @extended after calling _Excel_RangeRead? Did you read the wiki about Excel? MateusAMOK 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 Link to comment Share on other sites More sharing options...
MateusAMOK Posted February 21, 2022 Author Share Posted February 21, 2022 (edited) 1 hour ago, Nine said: Show your script using post code method. Add also your xls file, so we can test. Make your script runable to us and eliminate all not related lines. Thanks. Ok, thank you 1 hour ago, water said: Can you please post the exact _Excel_RangeRead statement you use? Can you please post the value of @error and @extended after calling _Excel_RangeRead? Did you read the wiki about Excel? $campoInicio = InputBox("Linha INICIO", "Insira a Linha INICIO") $campoFim = InputBox("Linha FIM", "Insira a Linha FIM") $contaCadastroInicio = StringReplace($campoInicio, "a", "") $contaCadastroFim = StringReplace($campoFim, "a", "") $contaCadastroFim = $contaCadastroFim + 1 $excelPlanilha = _Excel_Open() $sWorkbook = @ScriptDir & "\plan1.xlsx" $workBookComplete = _Excel_BookOpen($excelPlanilha, $sWorkbook) While $contaCadastroFim > $contaCadastroInicio $excelCodigo = _Excel_RangeRead($workBookComplete, Default, $campoInicio) $excelCompatibilidade = _Excel_RangeRead($workBookComplete, Default, StringReplace($campoInicio, "A", "G")) ConsoleWrite(">>>>> DESCRIÇÃO DA CÉLULA: " & $excelCompatibilidade & @CRLF) ConsoleWrite("<<<<< " & @CRLF) $iLength = StringLen($campoInicio) $contaCadastroInicio = $contaCadastroInicio + 1 if $iLength == 2 Then $campoInicio = StringLeft($campoInicio,($iLength-1))&$contaCadastroInicio ElseIf $iLength == 3 Then $campoInicio = StringLeft($campoInicio,($iLength-2))&$contaCadastroInicio EndIf WEnd Thank you plan1.xlsx Edited February 21, 2022 by MateusAMOK Translate Link to comment Share on other sites More sharing options...
Developers Jos Posted February 21, 2022 Developers Share Posted February 21, 2022 @MateusAMOK, Could you please refrain from translating the quoted text? Thanks. MateusAMOK 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
water Posted February 21, 2022 Share Posted February 21, 2022 Please set parameter 5 to True to use the transpose method of the Excel UDF. This removes limitations of Excel's transpose method. Example: _Excel_RangeRead($workBookComplete, Default, $campoInicio, 1, True) MateusAMOK 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 Link to comment Share on other sites More sharing options...
Nine Posted February 21, 2022 Share Posted February 21, 2022 Your while loop is a tad complex for nothing : While $contaCadastroFim > $contaCadastroInicio $excelCompatibilidade = _Excel_RangeRead($workBookComplete, Default, StringReplace($campoInicio, "A", "G"), 1, True) ConsoleWrite(">>>>> DESCRIÇÃO DA CÉLULA: " & $excelCompatibilidade & @CRLF) ConsoleWrite("<<<<< " & @CRLF) $contaCadastroInicio += 1 $campoInicio = StringLeft($campoInicio, 1) & $contaCadastroInicio WEnd MateusAMOK 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
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