Jump to content

Dezypher

Members
  • Posts

    17
  • Joined

  • Last visited

Dezypher's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. thank you that sounds like it would work could you give an example...im trying to use a pid based entry but i am getting an error in the scrip... I have found where to see the handle in the window info viewer tool..but cannot send anything to this handle...is there a way to use the window PID instead...or can you send me an example of how to use the handle... thanks
  2. Hello all, I am trying to figure out how to send key strokes to a different window. So I have 2 notepad windows open and one of them is active...i want to send a some text to the other notepad window, but cannot figure out how to accomplish this. I can find the pid for each window and can activate them based off this pid but dont know how to send text to the other window without activating it first. thank you for your help
  3. Hello all, I have to say this forum has been a huge help with my learning and using of autoit. with that said, i have a new question that i am trying to figure out. i am making a gui "app" to display several lines from excel. i can get one line to work but what i need to do is to read out all the data where a colum is set to a specific value (for this example i will use the letter O...for open). I cant seem to figure this out. but if you could give me some pointers in the right direction perhaps i can add 2 and 2 and get it working. what needs to happen is read different columns in a row and the entire read function would be based on a value set on one of the columns. for example. in excel i have several columns like types of fruit large/small date picked time in box approx shippment time good/bad (again this is an example) what i need to do is display some of the info in a gui window for autoit. lets say i need to display the types of fruit, large/small, approx shippment time for all lines where good/bad is equal to good...and then loop it to show all the lines that equal this until a null value is reached. i have played around with this but have not figured out how to do it... any thougths can some one point me in the right direction...not asking any one to completely code this...just pointers...half the fun of creation is creating it...but im just at a loss here on this.. thanks
  4. ok if i modify the "$theFile = "dailyUtilization1a"&@mday&@mon&@year&".xlsm"" to point to the file with the full path it seems to work thanks again let me play with it and stuff now thanks a lot again
  5. #include <date.au3> dim $dailysave $oExcel = ObjCreate("Excel.Application") $oExcel.visible=1 $theFile = "dailyUtilization1a"&@mday&@mon&@year&".xlsm" MsgBox(4096, "test", $theFile) If FileExists($theFile) then $oExcel.WorkBooks.open($theFile) Else $oExcel.WorkBooks.open("C:\Users\keith.000\Documents\Work Intergration\dailyUtilization1.xltm") $oExcel.ActiveWorkBook.SaveAs ($theFile, "52");, "_FileFormat:=xlOpenXMLWorkbookMacroEnabled", "_CreateBackup:=False");, _FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ReadOnlyRecommended:=False, CreateBackup:=False) ;$oExcel.ActiveWorkBook.ActiveSheet.Cells(2,1).Value=@MDAY ;$oExcel.ActiveWorkBook.Save $oExcel.ActiveWorkBook.Close $oExcel.Quit EndIf ok correct me here but in this code excution if the file exist then we should only open the file and not close it out...and if the file does not exist then we should open excel using the file specified and then save it. what i am getting is if the file does not exist then we create it...if the file does exist then we open and try to save it...almost like the open is not working and jumping strait to the save as...
  6. ah yes ...a bit of older code the saveas...let me change that and see what happens.
  7. thanks for the update here but this give me the same thing...i open the file after its created and then it tries to save it again. being that the only save here is teh $oExcel.ActiveWorkBook.save i can only assume that this code is running after the file is created....let me modify this a bit to check for different things and try to figure out where its breaking at...and why this code is running....this is the issue that i have been having all along thanks for the help though... any other ideas?
  8. Hello all I was wondering how to do this...i have played around for a few days trying to get it to work but i cant seem to get it to do just what i want. what i would like is to check if a file exist and if it does open it, and if it does not then create it. this seams simple enough but i, for the life of me, cant seem to get it to work... i have tried if then else statements, select case statements, tried putting in @error to select different statements depending on what error i set..but nothing is working the way i need it to. what i seem to get is if the file does not exist then it will create it...but if the file exist then it opens the file and then runs the rest of the code to create the file and errors. any help / suggestions would be great...here are some of the code that i have tried. #include <date.au3> dim $dailysave, $error $oExcel = ObjCreate("Excel.Application") $oExcel.visible=1 If not FileExists("c:\users\keith.000\documents\dailyUtilization1a"&@mday&@mon&@year&".xlsm") then SetError(2) MsgBox(4096,"test", guictrlread($error)) MsgBox(4096, "test", GUICtrlRead(@error)) ;$error=@error MsgBox(4096, "test", GUICtrlRead($error)) MsgBox(4096, "test", @error -2) Select Case @error = 2 $oExcel.WorkBooks.open("dailyUtilization1a"&@mday&@mon&@year&".xlsm") Case @error > 2 $oExcel.WorkBooks.open("C:\Users\keith.000\Documents\Work Intergration\dailyUtilization1.xltm") $oExcel.ActiveWorkBook.SaveAs ("dailyUtilization1a"&@mday&@mon&@year&".xlsm", "52");, "_FileFormat:=xlOpenXMLWorkbookMacroEnabled", "_CreateBackup:=False");, _FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ReadOnlyRecommended:=False, CreateBackup:=False) ;$oExcel.ActiveWorkBook.ActiveSheet.Cells(2,1).Value=@MDAY $oExcel.ActiveWorkBook.Save $oExcel.ActiveWorkBook.Close $oExcel.Quit EndSelect #include <date.au3> dim $dailysave $oExcel = ObjCreate("Excel.Application") $oExcel.visible=1 If FileExists("dailyUtilization1a"&@mday&@mon&@year&".xlsm") then $oExcel.WorkBooks.open("dailyUtilization1a"&@mday&@mon&@year&".xlsm") Elseif not FileExists("dailyUtilization1a"&@mday&@mon&@year&".xlsm") then ;Else $oExcel.WorkBooks.open("C:\Users\keith.000\Documents\Work Intergration\dailyUtilization1.xltm") $oExcel.ActiveWorkBook.SaveAs ("dailyUtilization1a"&@mday&@mon&@year&".xlsm", "52");, "_FileFormat:=xlOpenXMLWorkbookMacroEnabled", "_CreateBackup:=False");, _FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ReadOnlyRecommended:=False, CreateBackup:=False) ;$oExcel.ActiveWorkBook.ActiveSheet.Cells(2,1).Value=@MDAY $oExcel.ActiveWorkBook.Save $oExcel.ActiveWorkBook.Close $oExcel.Quit EndIf #include <date.au3> $oExcel = ObjCreate("Excel.Application") $oExcel.visible=1 $open = Test_Excel_Creat() Func Test_Excel_Creat() If not FileExists("dailyUtilization1a"&@mday&@mon&@year&".xlsm")Then SetError(2) MsgBox(4096, "test", @error) MsgBox(4096,"test", @error <= 2) if @error <= 2 Then $oExcel.WorkBooks.open("C:\Users\keith.000\Documents\Work Intergration\dailyUtilization1.xltm") $oExcel.ActiveWorkBook.SaveAs ("dailyUtilization1a"&@mday&@mon&@year&".xlsm", "52");, "_FileFormat:=xlOpenXMLWorkbookMacroEnabled", "_CreateBackup:=False");, _FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ReadOnlyRecommended:=False, CreateBackup:=False) ;$oExcel.ActiveWorkBook.ActiveSheet.Cells(2,1).Value=@MDAY $oExcel.ActiveWorkBook.Save $oExcel.ActiveWorkBook.Close $oExcel.Quit EndIf If @error EndFunc as you can see i have tried several different ways to accomplish this simple task and they have all resulted in what i described above.
  9. thank you for your reply, how could i save a file suing a variable date? again i have tried different things and cannot get execel 2007 to do with with out error.
  10. has anyone noticed that wow did something to block autoit scripts from running into their enviroment. i have coded some very simple apps and i cannot get the mouse or keyboard commands to function with in wow any ideas?
  11. hello all i have been trying over and over to figure out what is going on with this, but i cant seem to get it i have created a simple little script to save and excel document the excel doc that I am opening is a templete and i want to save it with some date variables. here is my code: $oExcel = ObjCreate("Excel.Application") $oExcel.visible=1 $oExcel.WorkBooks.open("C:\Users\keith.000\Documents\Work Intergration\dailyUtilization.xltx") $oExcel.ActiveWorkBook.ActiveSheet.Cells(2,1).Value="test" msgbox(4096, "test", "C:\Users\keith.000\Documents\Work Intergration\dailyUtilization1"&@MON&@MDAY&".xlsx") $oExcel.ActiveWorkBook.SaveAs ("Filename:=C:\utilization\dailyUtilization1a.xlsm", "FileFormat:=xlOpenXMLWorkbookMacroEnabled", "CreateBackup:=False");, _FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ReadOnlyRecommended:=False, CreateBackup:=False) when i get this to run i get an error at teh saveas function. i have tried to use the excelcom_udf but i get the same error there too the error is: $oExcel.activeworkbook.saveas("filename:=C:\utilization\dailyutilization1a.xlsm", "fileformant:=xlopensmlworkbookmacroenabled", "createbackup:=false")^ERROR error: the requested action with this object has failed. can some one please shed some light here? thanks Dezypher
  12. that did it...thank you so much...
  13. ok i have been using autoit to help with some automation processes and i have hit a block here. i am trying to use the guictrlsetdata to populate a drop down list that shows 3 different variables (not the names but the value that the variable contains) i have tried lots of different ways to get this done and generally this will work with constants: GUICtrlSetData(-2,"Z|Q|S|X", "X") but how would you do this with variables? like this: guictrlsetdata(-1, $nextyear|$lastyear, $lastyear) this gives an error about not able to parse the line any ideas?
  14. ok i have tried this Sleep(5000) Send("A") While 1 $RESULT = PixelSearch ( 809, 410, 814, 418, 0xdbdd48, 12) If NOT @ERROR Then Send("{SPACE}") Send ("Z") ;Uncomment next line to break loop if pixel found ;ExitLoop EndIf Sleep(10) WEnd Sleep(3500) Send("A") but i do not see the yellow color or if the script detects teh yellow its not sending the space and the z any ideas?
  15. hello all I Have been trying to figure out Pixelsearch for the past 3 hours...i just cant seem to figure out how to get it to do what I want. what i am trying to do is have it watch an area on the screen for yellow...once it sees yellow in this area to send a {SPACE} and then send a Z. So the yellow is not there by default but once it shows up it needs to send the characters listed above. my problem is i dont see a way to loop a wait or sleep so that the script will wait for the yellow to show up then hit space and z...and continue on with the script... any help would be greatly appreachited...just fustated right now thanks
×
×
  • Create New...