ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to use Java in Excel VBA? (https://www.excelbanter.com/excel-programming/317889-how-use-java-excel-vba.html)

Sirin

How to use Java in Excel VBA?
 
Hi,
On our intranet, we have a wab page where we can type a
doc number and click on submit button. When we click on
submit button the doc no is sent to the server and server
in return sends the most recent version of that document
to the wab page.
I want to get the latest version no for series of doc nos
listed in excel file.
I succeded in opening the pageand typing the doc number
but unable to click on the submit button
programatically.The error is runtime error no 91 " object
variable or with block variable not set"
So far I have this.
Sub NEW_DOC_NO()
Set ie = CreateObject("InternetExplorer.Application")

With ie
.Visible = True
.Navigate "http://docser.gis.com/webapp/jsp/nochang
e/YourNewNumber.jsp"
Do Until Not .Busy
DoEvents
Loop
Set ipf = ie.document.all.Item("OLD_MDN")
ipf.Value = "02232601093"
Set ipf = ie.document.all.Item("button")
ipf.Value = "Submit" <<<<ERROR LINE
ipf.Click

Do Until Not .Busy
DoEvents
Loop
End With

ie.ExecWB 17, 2
ie.ExecWB 12, 0

Range("A1").Select
ActiveSheet.Paste
End Sub

The submit button uses the following two java codes.
code1

<input type="button" name="Submit" class="buttonskeen"
value=" Submit " onclick="javascript:validateData()"

code 2

{

document.Mainform.action"http://docser.gis.com/webapp/jsp/n
ochange/YourNewNumber.jsp";
document.Mainform.submit();
}

May I know whats wrong with my code?
Any help is much appreciated.
Thanks.
Sirin



All times are GMT +1. The time now is 01:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com