Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Convert hard coded query criteria to Parameter Query | Excel Discussion (Misc queries) | |||
Excel 2007 / MS Query - editing existing query to another sheet | Excel Discussion (Misc queries) | |||
Save data retreived from query without saving query | Excel Discussion (Misc queries) | |||
How to use a Access Query that as a parameter into Excel database query | Excel Discussion (Misc queries) | |||
Stop to modify the SQL query manually entered into query ! | Excel Programming |