- Katılım
- 12 Kasım 2007
- Mesajlar
- 327
- Excel Vers. ve Dili
- excel 2003
Forumun değerli üyeleri
Aşağıda kopyaladığım kodu çalıştıramadım
"Dim clip As DataObject" bu stır hata vermektedir ne yapmam lazım?
Aşağıda kopyaladığım kodu çalıştıramadım
"Dim clip As DataObject" bu stır hata vermektedir ne yapmam lazım?
Sub GetTable()
Dim ieApp As InternetExplorer
Dim ieDoc As Object
Dim ieTable As Object
Dim clip As DataObject
'create a new instance of ie
Set ieApp = New InternetExplorer
'you don't need this, but it's good for debugging
ieApp.Visible = True
'assume we're not logged in and just go directly to the login page
ieApp.Navigate "http://severe-frost-552.heroku.com/login"
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
Set ieDoc = ieApp.Document
'fill in the login form - View Source from your browser to get the control names
With ieDoc.forms(0)
.login.Value = "dailydose"
.Password.Value = "password"
.submit
End With
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
'now that we're in, go to the page we want
ieApp.Navigate "http://severe-frost-552.heroku.com/"
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
'get the table based on the table's id
Set ieDoc = ieApp.Document
Set ieTable = ieDoc.all.Item("sampletable")
'copy the tables html to the clipboard and paste to teh sheet
If Not ieTable Is Nothing Then
Set clip = New DataObject
clip.SetText "<html>" & ieTable.outerHTML & "</html>"
clip.PutInClipboard
Sayfa1.Select
Sayfa1.Range("A1").Select
Sayfa1.PasteSpecial "Unicode Text"
End If
'close 'er up
ieApp.Quit
Set ieApp = Nothing
End Sub
Son düzenleme: