Jump to content

directbuy420

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by directbuy420

  1. Randall and Tone deaf, thanks for your help with this. I have modified the script to allow for choosing an excel file to be parsed. I have one last question....any chance you can tell me where its declaring colum "A" to be read and output to the text file, i need to change it to a different column. CODE Opt("MustDeclareVars", 1) ; Declarations Dim $oAppXL, $oWorkbook, $oWorksheet Dim $hOutputFile Dim $sWorkbookPath, $sOutputFilePath ; Flags declarations - Excel Global Const $xlCellTypeLastCell = 11 ; Initialize variables $sWorkbookPath = $var $sOutputFilePath = "C:\Documents and Settings\User\Desktop\GUI\Test.txt" ; Create Excel object $oAppXL = ObjCreate("Excel.Application") ; Check if object creation succeeded If Not IsObj($oAppXL) Then MsgBox(16, "ActiveX Error", "Excel object creation failed." & @CRLF & _ "Please verify the installation of Microsoft Excel.") Exit EndIf ; Open workbook and text file $oAppXL.Workbooks.Open($sWorkbookPath) $hOutputFile = FileOpen($sOutputFilePath, 2) ; Find the opened workbook in all the workbooks that are open For $i = 1 to $oAppXL.Workbooks.Count If $oAppXL.Workbooks($i).FullName = $sWorkbookPath Then $oWorkbook = $oAppXL.Workbooks($i) EndIf Next ; Associate first sheet in workbook with $oWorksheet $oWorksheet = $oWorkbook.Worksheets(1) ; Read all rows in column A and write contents to output text file For $i = 1 to $oWorksheet.Cells.SpecialCells($xlCellTypeLastCell).Row FileWriteLine($hOutputFile, $oWorksheet.Cells($i, 1).Value) Next ; Close files FileClose($hOutputFile) $oAppXL.Quit
  2. Ok guys, you have been more help than i can express, however i have one last question. I am almost done with my script and i am ahaving a problem with the last section. here is my code for this section... $file = FileOpen("temp.txt", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop MsgBox(0, "Line read:", $line) ControlSendPlus("DirectBuy Temp Code - Message - Microsoft Word", "", "_WwG1", "$line",1 ) Wend FileClose($file) So the code is reading a value from the text file...saving it to a variable..then ouputing it to a message box, then I am trying to send it to an edit box in an email that is already open...earlier in the script i am succesfully writing to the email fields with the controlsend key, so i know it is not the classname i am using, i am just not sending the variable correctly..or is it noteven possible to send a variable with control send? If not could you suggest an alternate way? Thanks guys
  3. yah lol im an idiot, i got it to work. thanks i appreciate it
  4. guys that was great, i was able to modify the scrip to do what i needed to do, i really appreciate it, and randall you were right the 1st script worked perfectly. I do have one more question, i would like to be able to have some type of open file box or select file box to choose which file the script will parse, is this possible?
  5. OK i have read the excelcom udf and played with many of the examples, written my own basic add and copy script. I am still completely lost. Can someone please get me started on writing a basic script to read column A from test.xls and output it to a text file I would appreciate this greatly.
  6. dale thank your for your help previously, i was able to get that section of my script working. I would appreciate some help on a new subject, would it be possible to read all the values out of a series of cells in a specific column in a excell file, for example column A cells 1-20, and then output them into the TO: field in a microsft outlook email, basically to send an email to all of the email addresses located in that column in the excell sheet? 2nd question, would it be possible to create a function that would alow me to choose the excell file the above function parsed? Bashically a select file box to select the file that the above function would be applied to? I am a marketing manager for a small company and am trying script some of my followup work. If anyone can help, i would apprectate any information you can provide Thanks in advance Jason
  7. to expand on what i would like to do - i would like to use your ie.au3 functions to control the webpage embedded in the tab
  8. I would like to have a gui, with a tab interface, in one of the tabs I would like to open an internet explorer window. I would then like to be able to automate some functions of that web page. I have the tab, and the webpage in the tab, I cannoy however send commands to that webpage right now. how would i accomplish this?
  9. I am new to using autoit, i am opening an explorer shell in a tab of a gui. I would like to communicate with this webpage...what am i doing wrong? here is my code #include <IE.au3> $Tab=GUICtrlCreateTab (0,0, 1000,700) $Tab0=GUICtrlCreateTabitem ("Database") $oIE = ObjCreate("Shell.Explorer.2") $GUIActiveX = GUICtrlCreateObj($oIE, 10, 25, 900, 670) GUICtrlSetStyle($oIE, $WS_VISIBLE) $oIE.navigate("http://directbuy420.com/admin/admin/") ; get pointers to the login form and username and password fields $o_form = _IEFormGetObjByName($oIE, "logoninfo") $o_login = _IEFormElementGetObjByName($o_form, "username") $o_password = _IEFormElementGetObjByName($o_form, "password") ; Set field values and submit the form _IEFormElementSetValue($o_login, "blank") _IEFormElementSetValue($o_password, "blank") _IEFormSubmit($o_form) Exit I relize i may need to use the ie attach function, but a m not sure as to how to do that any help would be greatly appreciated. Note - If in attempting to help someone checks the page i am loading, i understand that the form names in the above code are incorrect. Thank you in advance Edit - It returns the error that the objects declared must be valid objects, it is not finding the objects because it does not see the shell window i guess. how would i activate that window inside the tab to send functions to it?
  10. I am new to using autoit, i am opening an explorer shell in a tab of a gui. I would like to communicate with this webpage...what am i doing wrong? here is my code #include <IE.au3> $Tab=GUICtrlCreateTab (0,0, 1000,700) $Tab0=GUICtrlCreateTabitem ("Database") $oIE = ObjCreate("Shell.Explorer.2") $GUIActiveX = GUICtrlCreateObj($oIE, 10, 25, 900, 670) GUICtrlSetStyle($oIE, $WS_VISIBLE) $oIE.navigate("http://directbuy420.com/admin/admin/") ; get pointers to the login form and username and password fields $o_form = _IEFormGetObjByName($oIE, "logoninfo") $o_login = _IEFormElementGetObjByName($o_form, "username") $o_password = _IEFormElementGetObjByName($o_form, "password") ; Set field values and submit the form _IEFormElementSetValue($o_login, "blank") _IEFormElementSetValue($o_password, "blank") _IEFormSubmit($o_form) Exit I relize i may need to use the ie attach function, but a m not sure as to how to do that any help would be greatly appreciated. Note - If in attempting to help someone checks the page i am loading, i understand that the form names in the above code are incorrect. Thank you in advance
×
×
  • Create New...