K,
I have tried that but the excel app remains open.
Here's the code
Thanks in advance
Sub Auto_Open()
'
' Auto_Open Macro
' Macro recorded 1/7/99 by Joe Franchina
'
'
Dim newname, fName As String
If FileLen("c:\temp\pqs.txt") <> 0 Then
' Workbooks.OpenText FileName:="C:\TEMP\pqs.txt",
Origin:=xlWindows, _
' StartRow:=1, DataType:=xlFixedWidth,
FieldInfo:=Array(Array(0, 2), Array(6, _
' 2), Array(33, 2), Array(40, 2), Array(44, 2),
Array(58, 3), Array(69, 1), Array(80, 3), _
' Array(91, 2), Array(102, 2), Array(112, 2), Array
(124, 2), Array(133, 2), Array(141, 2), _
' Array(146, 2), Array(174, 2), Array(194, 2), Array
(203, 2), Array(208, 2), Array(213, 2), _
' Array(218, 2), Array(223, 3), Array(244, 2), Array
(255, 2), Array(260, 2), Array(265, 2), _
' Array(275, 3), Array(285, 3), Array(295, 3))
Workbooks.OpenText FileName:="C:\TEMP\pqs.txt",
Origin:=xlWindows, _
StartRow:=1, DataType:=xlFixedWidth,
FieldInfo:=Array(Array(0, 2), Array(6, _
2), Array(33, 2), Array(40, 2), Array(44, 2), Array
(58, 3), Array(71, 3), Array(82, 2), _
Array(93, 2), Array(104, 2), Array(113, 2), Array
(118, 2), Array(146, 2), Array(166, 2), _
Array(175, 2), Array(180, 2), Array(185, 2), Array
(190, 2), Array(195, 3), Array(216, 3), _
Array(226, 2), Array(231, 2), Array(236, 3), Array
(248, 3), Array(260, 3), Array(270, 3), _
Array(280, 3))
Rows("1:1").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.ShrinkToFit = False
.MergeCells = False
End With
Columns("A:A").EntireColumn.AutoFit
Columns("B:B").EntireColumn.AutoFit
Columns("C:C").EntireColumn.AutoFit
Columns("D

").EntireColumn.AutoFit
Columns("E:E").ColumnWidth = 14
Columns("F:F").EntireColumn.AutoFit
Columns("G:G").EntireColumn.AutoFit
Columns("F:G").Select
Selection.NumberFormat = "mm/dd/yyyy"
Columns("I:I").ColumnWidth = 9.43
Columns("J:J").EntireColumn.AutoFit
Columns("K:K").EntireColumn.AutoFit
Columns("L:L").ColumnWidth = 11.57
Columns("M:M").ColumnWidth = 14.43
Columns("N:N").ColumnWidth = 5.14
Columns("O:O").ColumnWidth = 1.71
Columns("P

").ColumnWidth = 2
Columns("Q:Q").ColumnWidth = 2
Columns("R:R").ColumnWidth = 2
Columns("S:S").ColumnWidth = 12.29
Columns("T:T").ColumnWidth = 9.43
Columns("S:T").Select
Selection.NumberFormat = "mm/dd/yyyy"
Columns("U:U").ColumnWidth = 1.71
Columns("V:V").ColumnWidth = 1.71
Columns("W:AA").Select
Selection.NumberFormat = "mm/dd/yyyy"
Rows("1:1").Select
Selection.AutoFilter
today = Date$
newname = "PQS"
ActiveSheet.Select
ActiveSheet.Name = newname
fName = Dir("c:\temp\pqs.xls")
If fName <> "" Then
Kill "c:\temp\pqs.xls"
End If
ActiveWorkbook.SaveAs FileName:="c:\temp\pqs.xls",
FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
ActiveWorkbook.Close
Windows("autoloadpqs.xls").Activate
ActiveWorkbook.Close
Else
MsgBox ("File c:\temp\pqs.txt is empty, check IBM
logon or PQS.DATA")
End If
Application.Quit
End Sub