|
-
Sep 17th, 2000, 08:29 PM
#1
Import a text file into Excel
I want to import a text file into Excel. I have a macro in Excel that does it quite well, however I want to handle everyting from VB & not have to have an Excel macrobook with my program. THis is the code I have so far, however, I'm having a problem getting the field_info:= line correct.
Private Sub Command1_Click()
Dim objXLApp As Object
' Launch Microsoft Excel
Set objXLApp = CreateObject("Excel.Application")
objXLApp.Visible = True
With objXLApp
Workbooks.Open.Text("C:\WINDOWS\TEMP\MP3_Export.txt", file_origin:=2, start_row:=1, _
file_type:=1, text_qualifier:=3, consecutive_delim:=False, tab:=True, _
semicolon:=False, comma:=False, Space:=False, Other:=True, other_char:="-", _
field_info:=Array(Array(1, 2), Array(2, 2)))
End With
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|