Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How keep each column size? Look my code, Missing data

Status
Not open for further replies.

gads

IS-IT--Management
May 26, 2003
2
MX
Hi all,

I'm opening a text file and saving it as DBF. Convertion is OK, but some of my columns get cut when open DBF. Each column is comma delimited, some cols are bigger than others, some are 1 character long. How keep each column size without missing data?

Sub Conv()
Dim dName$
dName = "C:\arch.txt"
Workbooks.Open filename:=dName, Format:=1
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs "C:\archdb.dbf", 11
ActiveWorkbook.Close
End Sub

Thanks in advance,
gads
 
There appears to be a data width limitation within the DBF4 format, but I can get close if I change the input file extension to .csv and put this line in before the SaveAs:
[blue]
Code:
    ActiveSheet.UsedRange.Columns("A:IV").AutoFit
[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top