Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem Importing Delimited Data from IE
I am having a problem with getting the delimited text data
from IE to the clipboard to cell "A1". I can copy all data into a single cell. I am trying to mimic the manual process of Selecting All on a delimited text web page, Copy and then Pasting it into my worksheet. I have Office 2K I have tried: Clipboard.Clear Clipboard.SetText ie.Document.Body.InnerText.Copy (I got this from working VB6 code) It fails at the first reference of the Clipboard so I didn't show the rest. I've tried the following also: ie.Document.Body.InnerText Destination:=ActiveWorkbook.Worksheets(1).Range("A 1") Any Ideas? Thanks, Jim |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem Importing Delimited Data from IE
Excellent suggestion Tom - Many thanks
Here's what I did: Dim ie As Object Dim ABC As New DataObject Set ie = CreateObject("InternetExplorer.Application") ie.Navigate sURL_Link Do Until ie.ReadyState = 4 'Busy DoEvents Loop ClearClipboard ABC.SetText ie.Document.Body.InnerText ABC.PutInClipboard Worksheets(PrefixedPN).Select Range("A1").Select GetOffClipboard ActiveCell.PasteSpecial Here's The Additional Code from Chip Pearsons Site that I used. Public Sub PutOnClipboard(Obj As Variant) Dim MyDataObj As New DataObject MyDataObj.SetText Format(Obj) MyDataObj.PutInClipboard End Sub Public Function GetOffClipboard() As Variant Dim MyDataObj As New DataObject MyDataObj.GetFromClipboard GetOffClipboard = MyDataObj.GetText() End Function Public Sub ClearClipboard() Dim MyDataObj As New DataObject MyDataObj.SetText "" MyDataObj.PutInClipboard End Sub -----Original Message----- there is no clipboard object in VBA. The closest is the DataObject. See Chip Pearsons page on this for examples of how to use it. http://www.cpearson.com/excel/clipboar.htm -- Regards, Tom Ogilvy Jim W. wrote in message ... I am having a problem with getting the delimited text data from IE to the clipboard to cell "A1". I can copy all data into a single cell. I am trying to mimic the manual process of Selecting All on a delimited text web page, Copy and then Pasting it into my worksheet. I have Office 2K I have tried: Clipboard.Clear Clipboard.SetText ie.Document.Body.InnerText.Copy (I got this from working VB6 code) It fails at the first reference of the Clipboard so I didn't show the rest. I've tried the following also: ie.Document.Body.InnerText Destination:=ActiveWorkbook.Worksheets(1).Range("A 1") Any Ideas? Thanks, Jim . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to use first row of delimited file for field names when importing ? | New Users to Excel | |||
Importing text file and changing default to delimited | Excel Discussion (Misc queries) | |||
Importing MM:SS From Tab Delimited File and Charting | Charts and Charting in Excel | |||
Importing Comma delimited file | Excel Discussion (Misc queries) | |||
Importing a part of a big comma delimited csv-file | Excel Worksheet Functions |