Jump to content

Recommended Posts

Posted

What have you tried so far?

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

i tried this

$q_dsl="";
$var = "C:\Users\ZJMD2860\Desktop 1.xlsx"
Func Check_Fichier()
$f_vp = FileOpen($var, 0)
If $f_vp = -1 Then
    MsgBox(0, "Erreur", "Impossible d'ouvrir le fichier : " & $f_vp )
    Return 0
    Exit
EndIf
;~ $q_dsl = StringUpper(InputBox("Reprise ?", "Saisir un DSLAM de reprise si besoin." & @CRLF & @CRLF & "Sinon cliquez CANCEL OU ESC pour TOUT traiter.", "", " M8"))
;~ $q_pop = StringUpper(InputBox("PoP ?", "Saisir le nom du POP pour le suivi : .", "", " M3"))
;~ $q_dsl = ""
;~ $q_pop = 'BOR'
; Comptage nombre de lignes
Global $ligne = 0 ; n° ligne active
Global $nbr_ligne = 0 ; Nbr de ligne à traiter
While 1
    $l_vp = FileReadLine($f_vp)
    If @error = -1 Then ExitLoop
    $ls_vp = StringSplit($l_vp, ";")
    If StringLeft($ls_vp[1],2) = "NM" Then Global $q_pop = StringMid($ls_vp[1],3,3)  ;Saute la 1ère ligne des champs
    If StringLeft($ls_vp[1],2) = "DS" Then $nbr_ligne = $nbr_ligne + 1  ;Saute la 1ère ligne des champs
    If StringInStr(StringUpper($l_vp),StringUpper($q_dsl)) Then Global $q_dsl_ok = 1  ;Saute la 1ère ligne des champs
    If StringInStr(StringUpper($l_vp),StringUpper($q_dsl)) Then Global $ligne = $nbr_ligne  ;Saute la 1ère ligne des champs
Wend
FileClose($f_vp )
Return 1
EndFunc


but didn't open anything

Posted

i tried also this

include <Array.au3>
#include <Excel.au3>
#include <MsgBoxConstants.au3>

; Create application object and open an example workbook
Local $oExcel = _Excel_Open()
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
Local $oWorkbook = _Excel_BookOpen($oExcel, @ScriptDir & "Z:\Stage2016\1.xlsx")
If @error Then
    MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example", "Error opening workbook '" & @ScriptDir & "Z:\Stage2016\1.xlsx'." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
    _Excel_Close($oExcel)
    Exit
EndIf

; *****************************************************************************
; Read data from a single cell on the active sheet of the specified workbook
; *****************************************************************************
Local $sResult = _Excel_RangeRead($oWorkbook, Default, "A1")
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example 1", "Error reading from workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example 1", "Data successfully read." & @CRLF & "Value of cell A1: " & $sResult)

 

Posted

Looks good. So the Excel part is solved now?

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

_Excel_RangeRead writes the single cell to variable $sResult.
How to write this variable to your application depends on the application. Is it a Web application or a GUI?

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

Which browser do you run?

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

i want to delete same value for my application

iwrite the code for delete its ok but i should put the variable with my hand

and a have 50 variable in excel i wwant take those variable ant put it my application and delete them

Posted

Use the IE.udf it's delivered with AutoIt, you find in the part User Defined Function Reference ==> IE Management or just by tying

_IE_Example

in scite and using F1 to get help.

Posted

hi thank you for you

i still have probleme

this is my script

 #include <Excel.au3>

#include <IE.au3>

; TO ADD PREFFERED HOTELS FOR A CORPORATE ACCT, JUST CHANGE THE FOLLOWING TWO LINES

; THE URL AND CELL RANGE ARE ALL YOU NEED TO CHANGE AND BE SURE TO

; PUT YOUR EXCEL FILE IN YOUR SCRIPT DIRECTORY AND NAME IT HOTEL_LIST.XLS

;

$corporate_URL = "http://dvedvr44.rouen.francetelecom.fr:9013/ner-training/app/homepage"

$cell_range = "A1:A560"

$FilePath=@ScriptDir & "\1.xlsx"

$hotel_array =_Excel_RangeRead($FilePath,1,$cell_range) ; 1 means sheet 1

$nbr_hotels = UBound($hotel_array)-1 ; stores # of hotels

$oIE = _IEAttach ("eAdvantage help desk", "text")

_IENavigate ($oIE, $corporate_URL)

_IELoadWait ($oIE) ; wait til page loads completely
Func _Main()
    Global $oIE = _IECreate("www.vvv.com", 1)

    _IELoadWait($oIE)
    if WinActive('Log On - Microsoft Internet Explorer - company') = True Then
        MsgBox($MB_SYSTEMMODAL, "", "Exists", 1)
        ConsoleWrite("Exists" & @CRLF)
        WinActivate('Log On - Microsoft Internet Explorer - company')
        Signin($oIE)
    Else
        ;MsgBox($MB_SYSTEMMODAL, "", "Do not exists", 1)
        Global $oIE = _IECreate("http://dvedvr44.rouen.francetelecom.fr:9013/ner-training/app/homepage", 1)
        ConsoleWrite("Do not exists" & @CRLF)
        _IELoadWait($oIE)
        WinActivate('Log On - Microsoft Internet Explorer - company')
        Signin($oIE)
    EndIf
EndFunc

Func Signin(ByRef $oIE)
     Local $user_name = _IEGetObjById($oIE, "nom")
    _IEFormElementSetValue($user_name, "adm", 0)

    Local $password = _IEGetObjById($oIE, "password")
    _IEFormElementSetValue($password, "adm", 0)

$oTDs = _IETagnameGetCollection($oIE, "TD")
$oButtons = _IETagNameGetCollection ($oIE, "INPUT")
    For $oButton In $oButtons
        If $oButton.type = "submit" Then
            _IEAction ($oButton, "click")
            ExitLoop
        EndIf
    Next

Local $pa = _IEGetObjById($oIE, "id2")
    _IEFormElementSetValue($pa, "yee", 0)
$bouton = _IEGetObjById ($oIE, "id12")
_IEAction ($bouton, "click")
sleep(2000)

EndFunc

 

Posted

Please define "I still have problems".
Does your script crash? How far do you come? Does the login work?

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

@oulaya

Please read this:  * How to post code on the forum *

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...