Mosses Posted March 15, 2016 Posted March 15, 2016 (edited) Hi, I have a script which is running perfectly in Indian system, The same I am running in french system in which I am not able to read excel data. Can anyone help me on this. I have checked with keyboard language. changed to french to english and also changed excel language from french to english Edited March 15, 2016 by Mosses
Moderators JLogan3o13 Posted March 15, 2016 Moderators Posted March 15, 2016 @Mosses do you think, perhaps, that it would help us help you if you posted your script? water 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Mosses Posted March 17, 2016 Author Posted March 17, 2016 (edited) Please find my complete script... Thank you in advance to help me.. expandcollapse popup#include <Excel.au3> #include <MsgBoxConstants.au3> $WINDOW_NAME="Test" ; Ask for to be opened AutoItSetOption ( "WinTitleMatchMode",2) if not WinExists($WINDOW_NAME) then Msgbox (0,"",", de lancer , de se logguer, de lancer la fonction CICS1 et ENSUITE de relancer _DELETE.") exit endif ; Open source EXCEL file ; $FileName=@ScriptDir & "\TSM ODT list to delete.xls" $FileName=FileOpenDialog("Selectionner le fichier de suppression",@ScriptDir,"Suppr files (*.xlsx)",1) if not FileExists($FileName) then Msgbox (0,"","Error, fichier manquant : "& $FileName) Exit endif $oExcelDoc = ObjGet($FileName) ; Get an Excel Object from an existing filename if not IsObj($oExcelDoc) then Msgbox (0,"","Could not open "& $FileName & " as an Excel Object.") endif Msgbox (0,"","Merci de cliquer sur l'entête de la fenêtre ET DE NE PAS CLIQUER JUSQU'A LA FIN.") if WinWaitActive($WINDOW_NAME) = 0 then Msgbox (0,"","Error : Impossible de trouver la fenêtre " & $WINDOW_NAME) endif ; Iterate on each row $OEvent=ObjEvent("AutoIt.Error","nothing") ; Equal to VBscript's On Error Resume Next dim $row dim $column $row=2 ; Create application object $oExcel = _Excel_Open() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookOpen Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ; ***************************************************************************** ; Create a new workbook with only 1 worksheets ; ***************************************************************************** $oWorkbook = _Excel_BookNew($oExcel,1) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookNew ", "Error creating new workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookNew ", "Workbook has been created successfully with only 1 worksheets.") Wait() Global $k=3 _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, "a", "A2") _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, "b", "B2") _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, "c", "C2") _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, "d", "D2") _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, "e", "I2") _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, "f", "J2") do $a=$oExcelDoc.activesheet.cells($row,3).value if $a<>"" then Ensure() $b=$oExcelDoc.activesheet.cells($row,2).value $c=$oExcelDoc.activesheet.cells($row,1).value $d=$oExcelDoc.activesheet.cells($row,4).value $e=$oExcelDoc.activesheet.cells($row,9).value $f=$oExcelDoc.activesheet.cells($row,10).value ;Entering Screen Number and Aircraft code send("200") Wait() send($b) Wait() send("{enter}") Wait() ;Entering Screen Number, File Number , CSN And Item number. Ensure() Send("25u") Wait() send($d) Wait() send($a) if StringLen($b) = 8 Then send("{TAB}") Wait() elseif StringLen($b) = 9 Then Wait() endif send($c) Wait() send("{enter}") Wait() Wait() $f = StringLen($f) for $i=3 to $d ;Copy the Data Sleep(1000) send("{TAB}") if $row >= 3 Then for $j=1 to $f Send("{SHIFTDOWN}") send("{Right}") next Send("{SHIFTUP}") sleep(1000) Send("^c") Wait() Local $sData = ClipGet() Wait() Local $rowValueCF = "A"&$k Local $rowValueCA = "B"&$k Local $rowValueCSN = "C"&$k Local $rowValueItem = "D"&$k Local $rowValueCCS = "I"&$k Local $rowValueDT = "J"&$k Local $cfVAlue[$i] = [$a] Local $caVAlue[$i] = [$b] Local $csnValue[$i] = [$c] Local $itemValue[$i] = [$d] Local $ccsValue[$i] = [$i] ;Paste the Copied Data to Excel $asResult = StringRegExp($sData,'([.]{1,40})', 1) If @error == 0 Then Else _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $cfVAlue, $rowValueCF) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel Export ", "Error writing to worksheet." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $caVAlue, $rowValueCA) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel Excel Export", "Error writing to worksheet." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $csnValue, $rowValueCSN) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel Excel Export", "Error writing to worksheet." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $itemValue, $rowValueItem) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel Excel Export", "Error writing to worksheet." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $ccsValue, $rowValueCCS) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel Excel Export", "Error writing to worksheet." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $sData, $rowValueDT) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel Excel Export", "Error writing to worksheet." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Wait() $k = $k + 1 EndIf EndIf next EndIf $row=$row+1 ; Enter F2 to comeback if $row >= 4 Then send("{F2}") Sleep(1000) EndIf until $a="" ; Close file $oExcelDoc.Close Exit ; Check that is opened func Ensure() if WinWaitActive($WINDOW_NAME,"",1)=0 then MsgBox(0,"","Vous avez cliqué hors de (fenêtre " & $WINDOW_NAME & ") => arret des suppressions") exit endif endfunc ; Wait between two commands func Wait() sleep(350) endfunc Edited March 17, 2016 by JLogan3o13
Mosses Posted March 17, 2016 Author Posted March 17, 2016 From the above script it works fine till this line " _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, "f", "J2") " after that script stops...
Mosses Posted March 17, 2016 Author Posted March 17, 2016 hello, can not anyone help me on the above issue ASAP.. Thank you in Advance.
Moderators JLogan3o13 Posted March 17, 2016 Moderators Posted March 17, 2016 @Mosses in the future please use the <> symbol on the toolbar to put your code into a code box (I have done so for you above). Doing so makes the code much easier to read. Also, please do not bump your posts without waiting 24 hours (3 times in an hour is a little excessive). This may be the most important thing in the world to you, but you need to give forum users a chance to assist. We have volunteers from all over the globe; the person best equipped to assist you may not be online yet. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Mosses Posted March 17, 2016 Author Posted March 17, 2016 @JLogon Sure I will not bump posts without waiting for 24hours. Thanks for your quick response.
water Posted March 17, 2016 Posted March 17, 2016 You are mixing all possible ways to work with Excel. I think it would be sensible to limit it to the Excel UDF. This includes error handling etc. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now