Hi,
I'm trying to copy the data from the website and below is my code I'm
getting Dim clip As DataObject saying User defined type not defined. and
please verify the code whether its correct. My table id is table1.
[code]
Sub GetTable()
dataarr = Range("A2:A4") 'Change according to your criteria
For i = 1 To UBound(dataarr, 1)
If counter = 0 Then
store_value = dataarr(i, 1)
counter = 1
MsgBox store_value
Else
store_value = store_value & Chr(13) & dataarr(i, 1)
End If
Next
MsgBox store_value
Dim ieApp As InternetExplorer
'Dim ieDoc As Object
Dim ie As Object
Dim ieDoc As Object
Dim strReturnBody As String
Dim clip As DataObject
Set ie = CreateObject("InternetExplorer.application")
ie.Visible = True
ie.navigate
"http://<http://dm4cqv.on.bell.ca:30011/sbm/BizSolo/OrderProcessStatusQuery/EnterQuery.jsp?dummy=false>
abcde.com"
Do
Loop Until ie.ReadyState = READYSTATE_COMPLETE
Application.Wait DateAdd("s", 3, Now)
While ie.Busy
DoEvents
Wend
ie.Document.getElementById("SB_Name").Click
ie.Document.getElementById("SB_Name").Click
Application.Wait (Now + TimeValue("0:00:10"))
ie.Document.getElementById("orderNumber").Value = store_value
Application.Wait (Now + TimeValue("0:00:1"))
ie.Document.getElementById("SB_Name").Click
Set ieTable = ieDoc.all.Item("table1")
If Not ieTable Is Nothing Then
Set clip = New DataObject
clip.SetText "<html>" & ieTable.outerHTML & "</html>"
clip.PutInClipboard
Sheet1.Select
Sheet1.Range("A1").Select
Sheet1.PasteSpecial "Unicode Text"
End If
End Sub
[/code]
--
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
https://www.facebook.com/discussexcel
FORUM RULES
1) Use concise, accurate thread titles. Poor thread titles, like Please Help,
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.
NOTE : Don't ever post confidential data in a workbook. Forum owners and
members are not responsible for any loss.
---
You received this message because you are subscribed to the Google Groups "MS
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.