S
Stevie D
Hi,
I have a comma separated text file called TrainingGroupEvaluation.csv which
is exported from a database.
I have an Excel Workbook.that links to this text file and reds in data from
it to a worksheet called "Source_Data. I would like the worksheet to
automatically be refreshed with the data in this file when the workbook
opens.
My attempt is as follows: -
Sub Aut
pen()
Sheets("Source_Data").Select
Range("A2").Select
Selection.QueryTable.Refresh BackgroundQuery:=True
Cells.Select
Cells.EntireColumn.AutoFit
End Sub
When the workbook opens automatically nothing appears to happen. If I step
through the procedure I am prompted by the import text file dialogue to
specify the name of the textfile.
Can anybody help me please? Thanks.
I have a comma separated text file called TrainingGroupEvaluation.csv which
is exported from a database.
I have an Excel Workbook.that links to this text file and reds in data from
it to a worksheet called "Source_Data. I would like the worksheet to
automatically be refreshed with the data in this file when the workbook
opens.
My attempt is as follows: -
Sub Aut
Sheets("Source_Data").Select
Range("A2").Select
Selection.QueryTable.Refresh BackgroundQuery:=True
Cells.Select
Cells.EntireColumn.AutoFit
End Sub
When the workbook opens automatically nothing appears to happen. If I step
through the procedure I am prompted by the import text file dialogue to
specify the name of the textfile.
Can anybody help me please? Thanks.