
HTRN
Active Members-
Posts
22 -
Joined
-
Last visited
Everything posted by HTRN
-
<SOLVED>... Sorta. No I do not. BUT!!!! I have worked around the issue. Since there was not option to copy from file to file BUT there was a function to copy from sheet to sheet AND there was also a function to read a file into an array I simply read the file with the range I need as array into a 2nd sheet in the existing spreadsheet and THEN USE "_OOoCalc_RangeMoveOrCopy" to copy that data into the 1st sheet. As an aside, is your handle, "water", a reference to Bruce Lee's famous quote?
-
Morning all, I am trying to copy a range from sheet1 in an Open Office Calc File, .ods, to sheet1 in a second .ods file. I understand the example of how to copy from one sheet to another within the same file _OOoCalc_RangeMoveOrCopy($CalcSpreadsheet, "B4:C7", "C2", 1, -1, "Sheet2") _OOoCalc_RangeMoveOrCopy(ByRef $oObj, $sSrcRange, $sDestCell, $iFlag[, $vSrcSheet = -1[, $vDestSheet = -1]]) but was wondering if anyone has been able to make the leap from sheet1 spreadsheet1 to sheet1 spreadsheet2? or is there a different Open Office UDF I should be using?
-
Script only runs script for first 100 Elements in ARRAY
HTRN replied to HTRN's topic in AutoIt General Help and Support
All better now.. The guidance, both positive and negative were greatly appreciated. What fixed it? #AutoIt3Wrapper_UseX64=y -
Script only runs script for first 100 Elements in ARRAY
HTRN replied to HTRN's topic in AutoIt General Help and Support
I spoke too soon, still crashing with the win32 error -
Script only runs script for first 100 Elements in ARRAY
HTRN replied to HTRN's topic in AutoIt General Help and Support
Nice one! ok.. I have the most current version and that's when the trouble started. But, additional info... I just removed #include<date.au3> from the mix and that seems to have alleviated the issue. I am testing now.. I didn't use ubound() but I did change the 147 to a variable. and my ultimate plan is to use an external file to populate an array. So I don't have to worry about listing elements IN the script. -
Script only runs script for first 100 Elements in ARRAY
HTRN replied to HTRN's topic in AutoIt General Help and Support
OK, if anybody's still looking, The script ran perfectly AFTER I did the 2 line "Fix" for excel.au3 BUT after I upgraded, After the 2nd run, every time the script hits element 118 in the array, the autoit executable gets a win32 exception. Even if i run it 64 bit. I've already turned the debugger off in internet options, deleted the registry items mentioned on various sites. I have also changed the DEP setting in computer properties to be for windows programs and services only. Is there something else I'm missing? -
Script only runs script for first 100 Elements in ARRAY
HTRN replied to HTRN's topic in AutoIt General Help and Support
Just did.. -
Script only runs script for first 100 Elements in ARRAY
HTRN replied to HTRN's topic in AutoIt General Help and Support
This is my right of passage. I was not "Seeing" the error because I had been squeezing the log window down to a single line and all I saw was +>09:09:28 AutoIt3Wrapper Finished. Once I saw the error and posted it I also googled it and guess what.. DOH!!! Two little lines. Local $oWindow = $oExcel.Windows($oWorkbook.Name) ; <== Modified If IsObj($oWindow) Then $oWindow.Visible = $bVisible ; <== Modified Made the update to excel.au3 and badda bing, we are off to the races. Thanks for showing an interest in my plight and thanks to each of you offering your help in your own special way.. It really did make me dig in want to learn how to perfect my own code.. -
Script only runs script for first 100 Elements in ARRAY
HTRN replied to HTRN's topic in AutoIt General Help and Support
"C:\Program Files (x86)\AutoIt3\Include\Excel.au3" (227) : ==> Variable must be of type "Object".: $oExcel.Windows($oWorkbook.Name).Visible = $bVisible $oExcel.Windows($oWorkbook.Name)^ ERROR ->08:18:12 AutoIt3.exe ended.rc:1 +>08:18:12 AutoIt3Wrapper Finished. >Exit code: 1 Time: 123.1 Above is the error I get around the 97th to 100 loop thru. It looks like there's something breaking in the Excel script. I excluded the whole row of the array that includes the tickers that the loop fails on so I eliminated the possibility of a bad invisible character. Also as I stated earlier, I can break the array down to 3 different arrays, cut and paste accordingly 50 elements in the first and second, 23 in the third run the script 3 times using the smaller arrays and it completes perfectly, every time. below is my loop. and I use the two includes at the top of my script. #include <Excel.au3> #include <Date.au3> for $x = 0 to 147 step 1 ;Start Array Loop splashtexton("Day_Tickers",$Tkr[$x]&" "&$x+1 & "-" & _NowTime(),200,50,3600,0) if stringinstr(FileReadline($csv_put&$Tkr[$x]&".csv",1),"timestamp") then ;Check for good file download ;****************************************************************** ;Open EXCEL Spreadsheets and cut and paste amd Save Global $EO= _Excel_Open() GLobal $WB1= _Excel_BookOpen($EO , $CSV_TEMPLATE ,True) Global $WB2= _Excel_BookOpen($EO, $csv_put &$Tkr[$x]&".csv",TRUE) Global $WB3= $CSV_SaveAs & $Tkr[$x] local $oRange = $WB2.ActiveSheet.Range("A1:F7") _excel_rangeCopyPaste($WB1.ActiveSheet, $oRange , "A1") _Excel_BookClose($WB2) _Excel_BookSaveAs($WB1,$WB3,$xlCSV, True) _Excel_BookClose($WB1) if stringinstr(FileReadline($CSV_SaveAs&$Tkr[$x]&".csv",2),"HIT") then ;Generate the HIT Files FileCopy($CSV_SaveAs&$Tkr[$x]&".csv", $Hits,1) ;Generate the HIT Files else endIF ;****************************************************************** Else FileWrite($No_Ticker&$Tkr[$x]&$NoTkr_Suffix," ") EndIf Next processclose("Excel.exe") EXIT -
Script only runs script for first 100 Elements in ARRAY
HTRN replied to HTRN's topic in AutoIt General Help and Support
Oh, that is a given but, I am simply the script Guy, he is the money guy with the idea.. So..... I currently have to defer to him. -
Script only runs script for first 100 Elements in ARRAY
HTRN replied to HTRN's topic in AutoIt General Help and Support
I know, I know.... Sorry for the "cloak and dagger." Thank you for verifying that my array comes no where NEAR limitations. I wish I could just post the whole script and let you have at it but right now that is not an option. I promise in the future if I have a question, I will endeavor to provide all questionable code and current insights but for right now I will just have to break this down to smaller chunks and process it 50 elements at a time in 3 separate scripts. IF I ever work out a reason I will be sure to post. Again, to all of you, thank you for this form and the insights that bridge the gap in education between beginner, intermediate and expert autoit scriptors... -
Script only runs script for first 100 Elements in ARRAY
HTRN replied to HTRN's topic in AutoIt General Help and Support
Thanks to everyone for chiming in. I am developing with a friend who doesn't want the "CODE" public BUT!!. with the array posted below, imagine instead of just splashing a text message, I was doing some excel copying and pasting looping thru the same code for 148 elements. why does it loop thru perfectly as posted below, but dies every time on ogen, the last element in the 4th line of tickers when I am doing more complex processing between the <for next>? Am I hitting some limitation I don't know about? ;Setup the ticker array $sTkr = 'ABIL,ABIO,ACHV,ADIL,ADMA,AETI,AEZS,AKER,AKTX,ALDX,ALQA,AMRS,AMTX,ANY,APHA,ARCI,ASNA,ASNS,ATAI,ATOS,AVCO,AVEO,AWSM,AXGT,AXSM,' ;25 count $sTkr &= 'BIOC,BKS,BLIN,BMMJ,BOXL,BPTH,BURG,CAPR,CCCL,CEI,CIFS,CLDC,CLDX,CLRO,CODX,COTY,CPRX,CUI,DARE,DBD,DCIX,DFFN,DSS,EARS,EGAN,' ;25 count $sTkr &= 'ELTK,ENSV,EPZM,FBIO,FCSC,FET,FFHL,FIT,FLXN,FTFT,FTK,FTR,GENE,GEVO,GLBS,GME,GOGO,GSM,GTXI,HMNY,HSGX,IDRA,IGC,INNT,INPX,' ;25 count $sTkr &= 'JAGX,JMU,JNUG,KNDI,KTOV,LPCN,MARA,MAXR,MBIO,MBOT,MBRX,MDWD,MLNT,MRIN,MTFB,MTP,MTSL,MXC,NBEV,NK,NOV,NVAX,NVLN,OCX,OGEN,' ;25 count $sTkr &= 'OPTT,OVID,OXY,PDSB,PHUN,PLAG,PRPO,PTI,PULM,RBZ,RENN,REPH,RHE,RIOT,RKDA,RNN,SAEX,SCYX,SEEL,SFET,SGYP,SKYS,SLNO,SNOA,SOLO,' ;25 count $sTkr &= 'SPEX,SPI,SRNE,STAF,SUNW,SXTC,TBBK,TBLT,TMSR,TNXP,TTNP,UXIN,VTL,VTVT,VVPR,VXRT,WATT,WKHS,WORX,YRIV,ZKIN,ZSAN,ZYNE' ;23 count Global $Tkr = StringSplit($sTkr, ",", 2) for $x = 0 to 147 splashtexton("TICKER",$Tkr[$x]&" "&$x,400,400,1000,200) sleep(200) next -
Script only runs script for first 100 Elements in ARRAY
HTRN replied to HTRN's topic in AutoIt General Help and Support
yes Now, I say all of that to say this, when I use excel.au3 and run my script, when it hits the 100th item in the array, it exits. The script ends. No error, no hung spreadsheets, it just exits like its finished. It did it 4 times straight when tested. Why did it exit at the 100th item? -
Good Morning, I have yet again rearranged my script and I am now using an array to populate variables which is a blessing and makes life so much better. This issue now lies in the type of processing I do and how my script reacts to the array I have setup. Some background, I have a script that opens and manipulates spreadshseets manually, 1. Set my Array and do a for next loop 2. Open a spreadsheet, maximize it, move it to a Monitor 1 and It opens to the correctly highlighted cell 3. Open a second spreadsheet, maximize it, move it to monitor 2, and it also opens to the correctly highlighted cell 4. I activate spreadhseet on monitor 1 copy some data 5. activate spreadsheet on monitor 2 paste the data, 6. save the spreadsheet on monitor 2 and close it 7. close the spreadsheet on monitor 1. 8. look at the saved file for a specific string, if its there copy that file to a different place NEXT LOOP That works perfectly. I have 147 items in my array and they all generate a file accordingly with no errors, 3 straight runs without issue. Its not very time efficient and I have been looking into better ways to manipulate the Spreadsheets and found #include <Excel.au3>. With that little gem, I am able to run thru the spreadsheets very quickly. Old way, 14 seconds per item, with excel.au3, 1 second per item. Now, I say all of that to say this, when I use excel.au3 and run my script, when it hits the 100th item in the array, it exits. The script ends. No error, no hung spreadsheets, it just exits like its finished. It did it 4 times straight when tested. I went as far as to remove the major code and just step thru the array and splashtext a message that simply counts thru and it ran all the way up to 147. So I don't know what is happening. I just took the array and split it into 3 different arrays and with 50, 50 and 48 elements respective and as soon as the last item of the 2nd array finished the script stopped again. AT 100... Very Strange and I cannot find any logical reason OR any identified limitations on the number or elements in an array when using excel.au3.
-
so cutting and pasting from SciTE acutally captures the coding from the screen. TY. ;THANK YOU VERY MUCH!!
-
Once I saw your statement above, I realize how OVER complicated I was making it. InetGet ( "URL", "filename" [, options = 0 [, background = 0]] ) It was right there the whole time but I just didnt try it, URL, Filename..... Thank you very much and I will be LITERALLY testing every help file example as written BEFORE I come back for help.
-
I have been looking, and found a few indications of what I may be trying to do but unfortunately none of the examples fit. I am doing an API call from a website. This call doesn't point me to a file but uses my query string to pull a CSV file that then downloads. While I understand how to "GO GET" a file from a web page, I don't know how I would script this in AUTOIT. Fortunately there are some demos I can share to show what I mean. Instead of opening a browser, pasting the string and getting the file. I would like to do it all from inside the script. here is a URL that "Builds"a csv https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=MSFT&interval=5min&apikey=demo&datatype=csv Is there a way to pull that csv and put it specific directory using only AUTOIT, instead of having to open a browser, pasting the url and getting the download?(Which is what I do now)
-
Thank you for the info and I actually got it to work in theory. Haven't tried it in my full blown script just yet, BUT!! In typical fashion, I have once again changed my mind about how I want part of this script to run. I will be posting a new question..
-
I have a script that I want to convert to using variables so that I only have to have 1 iteration of the script and just use an array to process the next item in the array.What I am running into is an error within the function, "error:missing Next" and I can't quite figure out where I am missing the boat. Here is the code. Some may recognize their incorporated suggestions 😎 Also, how do I paste code in the forum so it shows up as it looks in SciTE Global $T[3] = ["A","B","C"] Global $x For $x = 0 to 2 Func _EXISTS($sFile = "C:\Users\XXXX\Downloads\$T[$x].csv", $iTimeout = 5000) ; $iTimeout in milliseconds Local $hTimer = TimerInit() ; start counting time While TimerDiff($hTimer) < $iTimeout If FileExists($sFile) Then Return True ; check if the file exists Sleep(100) ; do not hog the CPU WEnd ; if you reached this point, it means the file does not exist after timeout Return False EndFunc If _EXISTS() = "True" Then SplashTextOn("Display","It's There", 200,200,200,200) sleep(2000) splashoff else SplashTextOn("Display","It's Missing", 200,200,200,200) sleep(2000) splashoff next exit
-
Script to Check for File and Exit if not found after a time
HTRN replied to HTRN's topic in AutoIt General Help and Support
I appreciate the in depth information I get from InetGet ( "URL", "filename", $options , $background) but for this application which is run after hours on a PC as stand alone script, Orb's basic outline helped me build exactly what I needed. I simply plugged in the static data for the variables, plugged the returned "True" or "False" into my IF THEN ELSE statement and it works like a charm. -
Script to Check for File and Exit if not found after a time
HTRN replied to HTRN's topic in AutoIt General Help and Support
Thank you both. I will let you know how it shakes out.. -
I have a script that opens a web browser, enters in an URL and thru API pulls down a CSV file. This is the first step in my script and once the file is downloaded I move it from downloads to another directory and do some other processing. If this file doesn't download I want to skip that whole section and move on to the next API Download. I can't offer a sample of my script, Its kinda proprietary but the jist is this.>> Heres what I do now. shellexecute("Chrome.exe" , "https://www.somedb.com/query?FILEXYX&datatype=csv Sleep(4999) IF FileExists("C:\Users\jsmith \Downloads\XYZ.csv") then ;Clear Dropbox for Today's csv processing. FileDelete ("\\dropbox\dropbox\backups\*.*") HOUSEKEEPINGSTEPS PROCESSING STEPS ELSE ;close chrome winactivate("Untitled - Google Chrome","") winwaitactive("Untitled - Google Chrome","") send ("!{f4}") WinWaitClose("Untitled - Google Chrome","","") ENDIF (Rinse and repeat with a different filename in the shell execute. I need to get rid of the Sleep(4999) and put in some code that looks for the file for 5 seconds. If it appears at anytime between 01-5000 miliseconds, immediately drop to the regular code after the THEN and process normally, or if it doesn't exist after 5 seconds, drop me down to the ELSE/ENDIF