I'm currently working on a project, that grabs a csv file from a website, and puts it in a pre-defined page in my workbook. It works...to an extent, but it keeps creating new VBA projects that I'm not really understanding, and eventually stops workings. Note, for the particular website I'm extracting this from I cannot use internet explorer.
The Code I'm Using:
Private Sub CommandButton3_Click()
On Error Resume Next
Kill "C:\Users\Me\Downloads\products.csv"
On Error GoTo 0
Shell ("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe -url url-string-here")
Application.Wait (Now + TimeValue("00:00:25"))
sCSVLink = "C:\Users\Me\Downloads\file.csv"
sfile = "file.csv"
ssheet = "CurrentListings"
Set wnd = ActiveWindow
Application.ScreenUpdating = False
Sheets(ssheet).Cells.ClearContents
Workbooks.Open Filename:=sCSVLink
Windows(sfile).Activate
ActiveSheet.Cells.Copy
wnd.Activate
Sheets("CurrentListings").Paste
Application.DisplayAlerts = False
Windows(sfile).Close False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
Sheets("CurrentListings").Range("E:E").WrapText = False
End Sub
Like I said, it will work a few times but this happens each time:
Eventually it gives me a runtime error, any suggestions?