View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
John.Greenan John.Greenan is offline
external usenet poster
 
Posts: 175
Default Internet Table Transfer

There's a thread on here at

http://msdn.microsoft.com/newsgroups...127&sloc=en-us

that does something similar. It also uses the Windows API.

--
www.alignment-systems.com


"MBSNewbie" wrote:

Hi Everyone,
Does anyone have any experience trying to retreive data from the web into
Excel without using web query?
I've been trying for a few weeks and can only get as far as Excel Data into
the Internet, I manually select the data and copy then resume the macro.I'm
not sure how to get the info from the Internet into Excel. I'm not using any
add-ins. I hope this clarifies my earlier question, but I'm crunched for
time and I'm hoping there is someone out there who can help me.
Thanks!!!

Const url As String =
"https://www65.americanexpress.com/opm/en_US/ViewStatement"
Dim ie As Object, sampleData(1 To 2) As String, cTables As Object, X As
Integer
Dim MyArr As Variant, cl As Range, y As Worksheet, Account As String
'///Setting

For Each cl In Range([a2], [a33].End(3))
Account = cl.Value

Set ie = CreateObject("internetexplorer.application")
With ie

Dim ws As Worksheet
Dim newSheetName As String

.Visible = True
.navigate url

Do While .ReadyState < 4:
Loop
'///Send data to IE
With .Document.all
.acct.Value = Account
.submit1.Click
Do While ie.ReadyState < 4:
Loop
End With

End With

Sheets.Add Type:="Worksheet"
With ActiveSheet
.Move After:=Worksheets(Worksheets.Count)
.Name = cl.Value
End With
X = 1
For X = 1 To 10
Answer = MsgBox("Would You Like To Paste?", vbYesNo)
If Answer = vbYes Then
ActiveSheet.Paste
ActiveCell.SpecialCells(xlLastCell).Select
Else:
Cells.Select
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.EntireColumn.AutoFit
Cells.EntireRow.AutoFit
Range("A1").Select
Exit For
End If
Next X

Next


End Sub