#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Web query

I have written following query to pass date on web query
With .document.Forms(0)
.txtFromDt.Value = 05/02/2008
.txtToDt.Value = 05/02/2008
End With

Error message is thrown by system as "Object Variable or with block variable
not set"

Can anyone help me out to resolve this problem.

Thank you.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Web query

Try quoting those values. Something may also be missing, but your code
fragment is too small to tell.


Tim

"Vijay Kotian" wrote in message
...
I have written following query to pass date on web query
With .document.Forms(0)
.txtFromDt.Value = 05/02/2008
.txtToDt.Value = 05/02/2008
End With

Error message is thrown by system as "Object Variable or with block
variable
not set"

Can anyone help me out to resolve this problem.

Thank you.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Web query

The codes are attached herewith. You may not able to access to the site
specified

Range("A2").Select
ActiveCell.FormulaR1C1 = "=TODAY()- 1"
Range("D2").Select
Selection.Copy
Range("E2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ate = ActiveCell.Value
ActiveCell.FormulaR1C1 = "'" & ate
ate = ActiveCell.Value
Range("F2").Select
Selection.Copy
Range("G2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
onth = ActiveCell.Value
ActiveCell.FormulaR1C1 = "'" & onth
onth = ActiveCell.Value
Range("H2").Select
Selection.Copy
Range("I2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ear = ActiveCell.Value
ActiveCell.FormulaR1C1 = "'" & ear
ear = ActiveCell.Value


Dim ie As Object
' On Error GoTo 1
Set ie = CreateObject("InternetExplorer.Application")
With ie
.navigate "http://10.6.4.48/ET/index.html"
.Visible = True
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop

With .document.Forms(0)
.txtUname.Value = "XXXXXXX" 'Change to YOUR Login ID
.txtPass.Value = "YYYYYYYY" 'Change to YOUR password
.btnsubmit.Click
End With

Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop


' Date = Format$(Now(), "MM/DD/YYYY")
With ie
.navigate
"http://10.6.4.48/ET/ErrorTrade.jsp?PARAM1=5:&Header=OTHeader.jsp&RPTNA ME=Open%20Error%20Trades"
Application.DisplayAlerts = False
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 1)
Application.SendKeys ("{TAB 7}")
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
End With

Application.SendKeys "~"
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.SendKeys ("{TAB 4}")
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.SendKeys "~"
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 1)
' Windows("Book1.xls").Activate
' ActiveWorkbook.SaveAs Filename:="O:\Client details\EOD
Reports\Vandha\working\Opentrades.XLS", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
' Application.SendKeys ("%FX")
Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 1)
With ie
.navigate
"http://10.6.14.148/ET/ErrorTrade.jsp?PARAM1=6:&Header=UNTHeader.jsp&RPTN AME=Unauthorized%20Trades"
.Visible = True
Application.DisplayAlerts = False
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 1)
Application.SendKeys ("{TAB 4}")
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
End With

Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 1)

With .document.Forms(1)
Application.SendKeys ("01/04/2007") ' Date requires to be changed
every year
Application.SendKeys ("{TAB 7}")
End With

Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 1)
Application.SendKeys "~"
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 1)
Application.SendKeys ("{TAB 4}")
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.SendKeys "~"
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 2)
With ie
.navigate
"http://10.6.4.48/ET/ErrorTrade.jsp?PARAM1=3:D&Header=DNoErrHeader.jsp& RPTNAME=Dealerwise%20No.%20of%20Errors"
.Visible = True
Application.DisplayAlerts = False
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.SendKeys ("{TAB 4}")
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
End With

With .document.Forms(0)
.txtFromDt.Value = ate
.txtToDt.Value = ate
End With


End With

"Tim Williams" wrote:

Try quoting those values. Something may also be missing, but your code
fragment is too small to tell.


Tim

"Vijay Kotian" wrote in message
...
I have written following query to pass date on web query
With .document.Forms(0)
.txtFromDt.Value = 05/02/2008
.txtToDt.Value = 05/02/2008
End With

Error message is thrown by system as "Object Variable or with block
variable
not set"

Can anyone help me out to resolve this problem.

Thank you.





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Web query

Formatted like this I can't really figure out all those nested 'with'
blocks.
Can you create a smaller fragment which shows the same problem?

But start by quoting the values you're trying to assign to the textboxes.

Tim


"Vijay Kotian" wrote in message
...
The codes are attached herewith. You may not able to access to the site
specified

Range("A2").Select
ActiveCell.FormulaR1C1 = "=TODAY()- 1"
Range("D2").Select
Selection.Copy
Range("E2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ate = ActiveCell.Value
ActiveCell.FormulaR1C1 = "'" & ate
ate = ActiveCell.Value
Range("F2").Select
Selection.Copy
Range("G2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
onth = ActiveCell.Value
ActiveCell.FormulaR1C1 = "'" & onth
onth = ActiveCell.Value
Range("H2").Select
Selection.Copy
Range("I2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ear = ActiveCell.Value
ActiveCell.FormulaR1C1 = "'" & ear
ear = ActiveCell.Value


Dim ie As Object
' On Error GoTo 1
Set ie = CreateObject("InternetExplorer.Application")
With ie
.navigate "http://10.6.4.48/ET/index.html"
.Visible = True
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop

With .document.Forms(0)
.txtUname.Value = "XXXXXXX" 'Change to YOUR Login ID
.txtPass.Value = "YYYYYYYY" 'Change to YOUR password
.btnsubmit.Click
End With

Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop


' Date = Format$(Now(), "MM/DD/YYYY")
With ie
.navigate
"http://10.6.4.48/ET/ErrorTrade.jsp?PARAM1=5:&Header=OTHeader.jsp&RPTNA ME=Open%20Error%20Trades"
Application.DisplayAlerts = False
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) +
1)
Application.SendKeys ("{TAB 7}")
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
End With

Application.SendKeys "~"
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.SendKeys ("{TAB 4}")
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.SendKeys "~"
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) +
1)
' Windows("Book1.xls").Activate
' ActiveWorkbook.SaveAs Filename:="O:\Client details\EOD
Reports\Vandha\working\Opentrades.XLS", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
' Application.SendKeys ("%FX")
Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) +
1)
With ie
.navigate
"http://10.6.14.148/ET/ErrorTrade.jsp?PARAM1=6:&Header=UNTHeader.jsp&RPTN AME=Unauthorized%20Trades"
.Visible = True
Application.DisplayAlerts = False
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) +
1)
Application.SendKeys ("{TAB 4}")
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
End With

Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) +
1)

With .document.Forms(1)
Application.SendKeys ("01/04/2007") ' Date requires to be changed
every year
Application.SendKeys ("{TAB 7}")
End With

Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) +
1)
Application.SendKeys "~"
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) +
1)
Application.SendKeys ("{TAB 4}")
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.SendKeys "~"
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) +
2)
With ie
.navigate
"http://10.6.4.48/ET/ErrorTrade.jsp?PARAM1=3:D&Header=DNoErrHeader.jsp& RPTNAME=Dealerwise%20No.%20of%20Errors"
.Visible = True
Application.DisplayAlerts = False
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
Application.SendKeys ("{TAB 4}")
Do While .busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
End With

With .document.Forms(0)
.txtFromDt.Value = ate
.txtToDt.Value = ate
End With


End With

"Tim Williams" wrote:

Try quoting those values. Something may also be missing, but your code
fragment is too small to tell.


Tim

"Vijay Kotian" wrote in message
...
I have written following query to pass date on web query
With .document.Forms(0)
.txtFromDt.Value = 05/02/2008
.txtToDt.Value = 05/02/2008
End With

Error message is thrown by system as "Object Variable or with block
variable
not set"

Can anyone help me out to resolve this problem.

Thank you.







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert hard coded query criteria to Parameter Query Melanie[_2_] Excel Discussion (Misc queries) 0 July 15th 08 09:59 PM
Excel 2007 / MS Query - editing existing query to another sheet Hotpepperz Excel Discussion (Misc queries) 0 June 13th 08 06:53 PM
Save data retreived from query without saving query Anthony Excel Discussion (Misc queries) 0 January 25th 06 07:17 PM
How to use a Access Query that as a parameter into Excel database query Karen Middleton Excel Discussion (Misc queries) 1 December 13th 04 07:54 PM
Stop to modify the SQL query manually entered into query ! Olivier Rollet Excel Programming 6 November 3rd 04 08:34 AM


All times are GMT +1. The time now is 01:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"