Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/08/2018 in all areas

  1. Lazy coder. Help me i have a broken will to code. Help me, help me. I have no effort of my own, nor code to show for myself. Boo hoo.
    1 point
  2. Subz

    IMDb Top 250 extracter

    I'm bored so here is basic example: #include <Array.au3> #include <IE.au3> Local $oIE = _IECreate("https://www.imdb.com/india/top-rated-indian-movies", 1) Sleep(4000) Local $oMovies = _IETableGetCollection($oIE) For $oMovie In $oMovies If $oMovie.ClassName = "chart full-width" Then $aMovies = _IETableWriteToArray($oMovie, True) ExitLoop EndIf Next Local $sMovies = @ScriptDir & "\" & @YEAR & "-" & @MON & "-" & @MDAY & "_Top-Rated-Indian-Movies.csv" Local $hMovies = FileOpen($sMovies, 10) ;~ Create directory + overwrite contents Filewrite($hMovies, '"' & _ArrayToString($aMovies, '","', -1, -1, '"' & @CRLF & '"', 1, 2) & '"' & @CRLF) FileClose($hMovies) _ArrayDisplay($aMovies)
    1 point
  3. Got it working... Wish I could have found a reference for the VBProject object model somewhere on the web, but no luck. From numerous searches, bits-and-pieces gleaned from here-and-there, and lots of trial-and-error, I came up with this. Since I only have one code module in the workbook, it works without checking the module name. I left some of the other commands that worked with the VBProject object commented-out at the bottom in case anyone finds this of interest. (Macro manipulation in the Word or Excel UDF maybe?) $oExcel = ObjCreate("Excel.Application") With $oExcel .Visible = 0 .WorkBooks.Open("C:\test.xls") EndWith $oModules = $oExcel.ActiveWorkbook.VBProject.VBComponents For $y = 1 to $x Switch $oModules.Item($y).Type Case 1; BASIC $oModules.Remove($y) Case 100; Excel EndSwitch Next $oModules.Import("C:\Module1.bas") ; $oExcel.ActiveWorkbook.Save _ExcelBookClose($oExcel,1) ; ; For $oModule In $oModules; alternate referencing with $oModule instead of $oModules($x) ; ; $oModules.Item(1).CodeModule.CodePane.Show ; $oModules.Item(1).Activate ; $x = $oExcel.ActiveWorkbook.VBProject.VBComponents.Count ; ; With $oModules.Item($y).CodeModule ; .ReplaceLine (1 , "Sub SpellCheck()") ; .DeleteLines (10, 1) ; .InsertLines (7 , "TEST") ; EndWith ; ; ConsoleWrite("Excel Module: " & $oModules.Item($y).Name & ", Type: " & $oModules.Item($y).Type & @CR) ; ; For $z = 1 to $oModules.Item($y).CodeModule.CountOfLines ; ConsoleWrite(" " & $z & ": " & $oModules.Item($y).CodeModule.Lines($z, 1) & @CR) ; Next
    1 point
  4. 0 points
×
×
  • Create New...