Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel 2000 & importing text files
I have used a query table to import a text file with fixed widths in excel
2003 on my home computer. But when I open the file at work which uses office 2000 my text document is loaded into one cell, instead of the supposed 4 cells & not starting at A1 but D1. I have tried changing the fixed width array and the column data types to no avail. can anyone say why this will work in office 2003 but not 2000?? and make any suggestions?? the code: Sub Getfile() Dim fname As String fname = Application.GetOpenFilename _ (filefilter:="Text Files(*.txt),*.txt,All Files (*.*),*.*") If fname = "False" Then MsgBox "You Did'nt select a file" Exit Sub End If Set myquery = Workbooks(1).Worksheets(2) Set muncb = myquery.QueryTables _ .Add(Connection:="TEXT;" & fname, _ Destination:=myquery.Cells(1, 1)) With muncb .TextFileParseType = xlFixedWidth .TextFileFixedColumnWidths = Array(10, 10, 10, 10) .TextFileColumnDataTypes = _ Array(xlTextFormat, xlTextFormat, xlTextFormat, xlTextFormat) .Refresh End With End Sub Thanks Anthony |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Importing Text Files | Excel Discussion (Misc queries) | |||
Importing text files to Excel with big numbers | Excel Worksheet Functions | |||
Importing text files into Excel | Excel Discussion (Misc queries) | |||
importing several text files into different excel worksheet | Excel Programming | |||
Excel 2000 importing huge ASCII files into different sheets | Excel Programming |