Jump to content

Recommended Posts

Hello guys,
I built a gui where a GUICtrlCreateListView with two columns is present.
Through an "Import" button I would be able to import the contents of an .xls or .txt.

Can you help me?

Thank's

Share this post


Link to post
Share on other sites

Not at the moment...

 

Have a look ate ExcelRangeRead to get an array and use this data to populate your list view.

Examples are not hard to find when you have the name of the Function needed...;)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By VinMe
      Dear all, 
      I am unable to get the right result after applying the filter to the excel. please let me know on the same.
      issue: After applying the filter the output $lastRow11 not giving the right output of complete visible rows. (its breaking at row skips)
       
      ;DATA EXTRACTION FROM LOC EXCEL
      ;=============================================================================
      $oWorkbook = _Excel_BookAttach($sWorkbook)
      Local $sMSN = InputBox("MSN NO", "Enter MSN in XX FORMAT", "")
      ;~ Local $LastRow1 = ($oWorkbook.ACTIVESHEET.Range("A1").SpecialCells($xlCellTypeLastCell).Row)
      $LastRow1 = $oWorkbook.ActiveSheet.UsedRange.Rows.Count
      MsgBox(0, "lastrow1", $LastRow1)
      _Excel_FilterSet($oWorkbook, $oWorkbook.activesheet, "AF1", 32, "*" & $sMSN & "*")
      Local $oLocDS = $oWorkbook.ActiveSheet.Range("S1:S" & $LastRow1).SpecialCells($xlCellTypeVisible)
      Local $LastRow11 = $oLocDS.rows.count    ;error output
      MsgBox(0, "lastrow11", $LastRow11)
      Local $aLocDS1 = _Excel_RangeRead($oWorkbook, Default, $oLocDS)
      Local $oLocNr = $oWorkbook.ActiveSheet.Range("A1:A" & $LastRow1).SpecialCells($xlCellTypeVisible)
      Local $aLocNr1 = _Excel_RangeRead($oWorkbook, Default, $oLocNr)
      _ArrayDisplay($aLocDS1)
      _ArrayDisplay($aLocNr1)
      _ArrayTrim($aLocDS1, 6, 1)
      _ArrayTrim($aLocNr1, 6, 1)
      _ArrayTrim($aLocNr1, 6, 0)
      _ArrayDisplay($aLocDS1)
      _ArrayDisplay($aLocNr1)
    • By VinMe
      I am unable to execute the below script, my requirement is to copy the content from active excel sheet and to display the same.
      Please let me know where i am missing!
      #include <Excel.au3>
      #include <MsgBoxConstants.au3>
      #include <Array.au3>
      #include <StringConstants.au3>
      Local $oExcel = _Excel_Open()
      $LastRow2 = $oExcel.UsedRange.Rows.Count
      $Tissue = _Excel_RangeRead($oExcel, Default, "E1:E" & $LastRow2)
      $TshNr = _Excel_RangeRead($oExcel, Default, "F1:F" & $LastRow2)
      _ArrayDisplay($Tissue)
      _ArrayDisplay($TshNr)
    • By _leo_
      Hey there! 😃
      I am having a problem with the _Excel_RangeFind. I am trying to search for a value in a particular cell range. The script copies the value from the internet. Copying and saving as a variable is working fine, but as soon as it should find the value in excel, nothing happens. ( I am not getting an error)
      #include <Excel.au3> Func Excel() Send("{CTRLDOWN}") Send("{c}") Send("{CTRLUP}") Local $sName = ClipGet() ;Text Local $sShortName = StringTrimRight ( $sName, 1) ;delete one letter Local $bOpenWorkBook = False, $oExcel = _Excel_Open() Local $sFilePath = "C:\Users\Acer\OneDrive\xyz.xlsx" Local $oWorkbook $oWorkbook = _Excel_BookAttach($sFilePath) If @error Then $oWorkbook = _Excel_BookOpen($oExcel, $sFilePath) $bOpenWorkBook = True EndIf sleep(15000) Send("{LWINDown}") Send ("{up}") ;maximize window Send("{LWINup}") sleep(1000) _Excel_RangeFind ($oWorkbook, $sShortName, "A3:A56") EndFunc Is anyone familiar with this problem or am I just missing some basic stuff? 
      Thanks for help!
    • By _leo_
      Hey guys
      I'm new to autoit, so this could be a simple question. I'm trying to read the value from the currently selected cell in Excel. I read on the forum and tired to find videos, but I couldn't quite get to it. 
      This is what I have got so far:
       
      Local $oExcel_1 = _Excel_Open()
      Local $var = "C:\Users\Acer\xy"
      Local $oWorkbook = _Excel_BookOpen($oExcel_1,$var)
       
      Local $_read1 = _Excel_RangeRead($oWorkbook, Default.Application.ActiveCell.Address)
       
      Whatever I try, I either get an error or it only reads "0".
       
      Thank you very much for any helpful thoughts!
    • By NSUSpray
      - file scope in AutoIt programs
      - module-private functions and variables
      - python-like import operator
      Code is 10% lighter!
      This inconspicuous wrapper complements the AutoIt language with
      preprocessor keyword #import in addition to #include similar to import in Python Python-like blocking by lines indentation (without endfunc, wend etc.) dim and const outside of functions means global and global const respectively, inside of functions means local and local const arguments of function are const by default, but with dim prefix it becomes variable short synonyms for functions as a rule using in large projects: for arrays, files and strings no “$”-prefix in variable names ; file “mylib.aup” dim bar, _bar func foo() bar = _foo() func _foo(dim str="word/number/space") _bar = Sort(Split(str, "/", @NoCount)) ; file “main.aup” #import "mylib.aup" In this example variable _bar and function _foo() are private for module mylib.aup (names begin with an underscore) and not visible in main.aup. Variable bar and function foo() will be visible with the “mylib:” prefix:
      ; file “main.aup” #import "mylib.aup" bar = foo() ; error: no bar and foo() in this scope mylib:bar = mylib:foo() ; OK: bar and foo() are public in “mylib” scope mylib:_bar = mylib:_foo() ; error: _bar and _foo() are private in “mylib” scope Sort is synonym for _ArraySort, Split is synonym for StringSplit, @NoCount is synonym for $STR_NOCOUNT.
      All synonyms
      How to use this wrapper
      Place the “plys.au3” file in the “Include” folder (C:\Program Files (x86)\AutoIt3\Include\). Make in your project folder au3-file with this content #include <plys.au3> #plys "MainFileOfMyProject.aup" ; run me!  
      Then, if you have the files module1.aup and module2.au3 with the same names ; module1.aup dim bar, _bar func foo() ; instructions ; module2.au3 global $bar func foo() ; instructions endfunc func _foo() ; instructions endfunc you can write in your program like this ; MainFileOfMyProject.aup #import "module1.aup" #import "module2.au3" module1:bar = module2:foo() ;module1:_bar = module2:_foo() ; error because _bar and _foo() are private (with underscore prefix) #import "module2.au3" ; re-importing files without "#include-once" will not lead to errors  
      You can turn off data exchange through standard input/output streams, then the shell process will not hang in memory, but then you will not be able to observe the output of your program in the output window of your development environment. You can do this by adding a line to the main file of your program
      #plys nostdio You can disable autorun of your program altogether, keeping only the generation of executable files, for example, for further compilation, adding the line to the main file of your program
      #plys norun Then you can compile the program, specifying to the compiler the resulting file main.aup.au3, if the main file of your program is called main.aup.
      File processing is pretty dumb, so bugs are possible.
      How it works
      The plys.au3 file contains the code that is run immediately after the launch of your program: files are automatically processed, after which the new AutoIt process interprets the already converted code, and the current process remains cycle to continue data exchange with the new process via standard streams. This handler replaces all #import with #include. The processed files get the extension .aup.au3 and are placed in the folder of the original script with hidden attribute.
      One more example
      TODO
      #import from "filename.aup" #import from "mylib.aup" bar = foo() ; bar and foo will be taken from the "mylib.aup" #import "filename.aup" as alias #import "mylib.aup" as ml ml:bar = ml:foo() ; bar and foo will be taken from the "mylib.aup" Optimize translation speed Download
      Current version https://github.com/NSUSpray/plys
      Old version (import only): import
×
×
  • Create New...