ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Object or with block not set (https://www.excelbanter.com/excel-worksheet-functions/211463-object-block-not-set.html)

sidw0501

Object or with block not set
 
Can anyone help me solve this "Weird" problem. Here's my Code:

Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
Range("A1").CurrentRegion.SpecialCells(xlVisible). Select
Selection.Copy
ie.Navigate URL:="https://live.lehman.com/EPW/loadpage.jsp?force=true"
Do Until Not ie.Busy
DoEvents
Loop

' creates data object
Set MyData = New DataObject
'gets data from the keyboad and stores it in the string
object

MyData.GetFromClipboard
Dim GetOffClipboard As String
'It gets Value from the clipboard and paste it in '
'the text area of the lehmanlive website

GetOffClipboard = MyData.GetText()
'Error is shown in next line of code, most of the time
(ERROR IS MARKED here) ie.Document.all.Item("tickertextarea").Value
= GetOffClipboard
'automatically clicks the buttom1 buttom.
ie.Document.all.Item("buttom1").click()

But I am going through some kinda on and off error. sometimes the code
runs perfectly fine. But for most of the time,in the aboved-marked
line the error occurs saying:
OBJECT VARIABLE OR WITH BLOCK VARIABLE NOT SET

I trying several different approach, but in vain
Help in this case greatly appreciated!!


All times are GMT +1. The time now is 09:24 AM.

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