Sign in to follow this  
Followers 0
RogerRabbitsClone

_ExcelReadCell to _IEFormElementSetValue

6 posts in this topic

hello autoiters

ive been stuck at this for a couple days (off and on) now and im just learning _IE and _excel UDFs.

ok, so i have an excel file with a bunch of publishers names that i have to request permission for to re-print. im trying to read from the excel file and put that into the IE form field. im using IE8 and Office 2007. this script keeps putting 0 into the form field and the help file says that "Return 0 = Row out of valid range" but thats not true. unless i messed up the syntax somehow. (?)

i am in need of assistance. and please excuse the messy code, ive left all my notes and ideas in there.

#include <IE.au3>
#include <excel.au3>
;before that it does a bunch of login crap
$oIE = _IEcreate ("http://www.copyright.com/")

WinWaitActive ("Copyright Clearance Center | The Rights Licensing Experts - Windows Internet Explorer")
_excelbookopen (@scriptdir & "publishers.xls")
$text= inputbox ("Reader thing ", "How many publishers are in this file?")
        ;$Xtimes = the X amount of time you said
        $excelfile= @ScriptDir & "Publishers.xls"
        $book =  _ExcelReadCell ($excelfile, "A2")
#cs
For $row = 3 To $text
    $book =  _ExcelReadCell ($excelfile, $row)
    ;_ExcelRowDelete ($excelfile, $row, $coulmn)
    
Next
#ce
MsgBox ("", "klasjdbf", $book);return somethingpretty dammit
$1form=_IEformGetObjByName ($oIE, "searchForm")
$1Query=_IEFormElementGetObjByname ($1form, "titleOrStdNo")
_IEFormElementSetValue ($1Query, $book) 
_IEFormSubmit ($1Form)
)

<--a good way to start you day

Share this post


Link to post
Share on other sites



Try this:

_excelbookopen (@scriptdir & "publishers.xls")
$book =  _ExcelReadCell ($excelfile,1,2)
MsgBox ("", "klasjdbf", $book)

What do you see in the msg box? And do you have anything in the A2 cell of publishers.xls ?Is the file located in the @scriptdir ?

Share this post


Link to post
Share on other sites

the msg box gives me "0". there is something in the script directory, and i have a book title in A2. ok, i changed the how it read the column/row, but im still getting a return of 0. what am i missing here? can _excel not port the info to _IE? i tried looking at the actual code in the UDF, but i dont understand it. where does he declare his variables?? ie $oExcel. i just see constants at the top of the UDF file.

WinWaitActive ("Copyright Clearance Center | The Rights Licensing Experts - Windows Internet Explorer")
_excelbookopen (@scriptdir & "Publishers.xls")
;$text= inputbox ("Reader thing ", "How many publishers are in this file?")
        ;$Xtimes = the X amount of time you said
        ;$excelfile= @ScriptDir & "Publishers.xls"
        $row=1
        $column=2
        $book =  _ExcelReadCell (@ScriptDir & "Publishers.xls", $row, $column)
#cs
For $row = 3 To $text
    $book =  _ExcelReadCell ($excelfile, $row)
    ;_ExcelRowDelete ($excelfile, $row, $coulmn)
    
Next
#ce
MsgBox ("", "klasjdbf", $book)

$1form=_IEformGetObjByName ($oIE, "searchForm")
$1Query=_IEFormElementGetObjByname ($1form, "titleOrStdNo")
_IEFormElementSetValue ($1Query, $book) ;----------------MUST GET FILEMAKER TITLE
_IEFormSubmit ($1Form)

<--a good way to start you day

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Try putting the full path to the excel file. IE is not the issue here as you cant read the value from the excel file.

Check the excel UDF examples in the help file. Also lower the macro security settings in excel.

What version of excel and OS do you have ?

Edited by Juvigy

Share this post


Link to post
Share on other sites

Try putting the full path to the excel file. IE is not the issue here as you cant read the value from the excel file.

Check the excel UDF examples in the help file. Also lower the macro security settings in excel.

What version of excel and OS do you have ?

i have office 07' and XP pro SP3 with all the trimmings

<--a good way to start you day

Share this post


Link to post
Share on other sites

hello autoiters

ive been stuck at this for a couple days (off and on) now and im just learning _IE and _excel UDFs.

ok, so i have an excel file with a bunch of publishers names that i have to request permission for to re-print. im trying to read from the excel file and put that into the IE form field. im using IE8 and Office 2007. this script keeps putting 0 into the form field and the help file says that "Return 0 = Row out of valid range" but thats not true. unless i messed up the syntax somehow. (?)

i am in need of assistance. and please excuse the messy code, ive left all my notes and ideas in there.

#include <IE.au3>
#include <excel.au3>
;before that it does a bunch of login crap
$oIE = _IEcreate ("http://www.copyright.com/")

WinWaitActive ("Copyright Clearance Center | The Rights Licensing Experts - Windows Internet Explorer")
_excelbookopen (@scriptdir & "publishers.xls")
$text= inputbox ("Reader thing ", "How many publishers are in this file?")
        ;$Xtimes = the X amount of time you said
        $excelfile= @ScriptDir & "Publishers.xls"
        $book =  _ExcelReadCell ($excelfile, "A2")
#cs
For $row = 3 To $text
    $book =  _ExcelReadCell ($excelfile, $row)
    ;_ExcelRowDelete ($excelfile, $row, $coulmn)
    
Next
#ce
MsgBox ("", "klasjdbf", $book);return somethingpretty dammit
$1form=_IEformGetObjByName ($oIE, "searchForm")
$1Query=_IEFormElementGetObjByname ($1form, "titleOrStdNo")
_IEFormElementSetValue ($1Query, $book) 
_IEFormSubmit ($1Form)
)

Change this _excelbookopen (@scriptdir & "publishers.xls")

to this $excelfile = _excelbookopen (@scriptdir & "publishers.xls")

Should do it for you

REB


MEASURE TWICE - CUT ONCE

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0