I have two csv tables imported into a spreadsheet and would like to automate the 'refreshing data' part so its run froma macro.
I have recorded a macro which should do the trick, but when I run it it falls over and cannot find the CSV file. The import text file dialogue box comes up, but until i click the file type 'text file' and reset it back to 'text file' the CSV isnt visible.
The two downloads are set to go straight to c:\data
Is there a way in VB to locate and load up the correct file ?
At the moment the macro code is...
Selection.QueryTable.Refresh BackgroundQuery:=False
I have recorded a macro which should do the trick, but when I run it it falls over and cannot find the CSV file. The import text file dialogue box comes up, but until i click the file type 'text file' and reset it back to 'text file' the CSV isnt visible.
The two downloads are set to go straight to c:\data
Is there a way in VB to locate and load up the correct file ?
At the moment the macro code is...
Selection.QueryTable.Refresh BackgroundQuery:=False