E
eltupac
I have been working on this for weeks. I am trying to import a .WRI file
into word, modify it, put it into columns, enter it into an excel file
and save it to .DBF.
I have everything but the parsing of the text in excel. I keep getting
an error. I modified the code found in here, but it crashes at the
"TEXTTOCOLUMNS" line.
This is the code:
Dim i As Integer
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlWB = xlApp.Workbooks.Add
xlWB.Activate
xlWB.ActiveSheet.Range("A1").Select
xlWB.ActiveSheet.Paste
'xlWB.ActiveSheet.Range("A1").Select
'xlSht.Select "A1"
xlApp.Selection.TextToColumns Destination:=Range("A1").Select,
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(22, 1), Array(32, 1),
Array(44, 1), Array(55, 1), _
Array(61, 1), Array(69, 1), Array(78, 1)),
TrailingMinusNumbers:=True
Columns("A:A").EntireColumn.AutoFit
Columns("A:A").ColumnWidth = 26.14
Columns("B:B").ColumnWidth = 9.57
Columns("C:C").EntireColumn.AutoFit
Columns("C:C").ColumnWidth = 11.71
Columns("D").EntireColumn.AutoFit
Columns("D").ColumnWidth = 11.14
Columns("H:H").EntireColumn.AutoFit
Thanks for any help
into word, modify it, put it into columns, enter it into an excel file
and save it to .DBF.
I have everything but the parsing of the text in excel. I keep getting
an error. I modified the code found in here, but it crashes at the
"TEXTTOCOLUMNS" line.
This is the code:
Dim i As Integer
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlWB = xlApp.Workbooks.Add
xlWB.Activate
xlWB.ActiveSheet.Range("A1").Select
xlWB.ActiveSheet.Paste
'xlWB.ActiveSheet.Range("A1").Select
'xlSht.Select "A1"
xlApp.Selection.TextToColumns Destination:=Range("A1").Select,
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(22, 1), Array(32, 1),
Array(44, 1), Array(55, 1), _
Array(61, 1), Array(69, 1), Array(78, 1)),
TrailingMinusNumbers:=True
Columns("A:A").EntireColumn.AutoFit
Columns("A:A").ColumnWidth = 26.14
Columns("B:B").ColumnWidth = 9.57
Columns("C:C").EntireColumn.AutoFit
Columns("C:C").ColumnWidth = 11.71
Columns("D").EntireColumn.AutoFit
Columns("D").ColumnWidth = 11.14
Columns("H:H").EntireColumn.AutoFit
Thanks for any help