Create a new version with an incremental version extension (for example adding '_v2' to the end of the file name) I decided to write VBA code for Excel as well as Miscrosoft Word and PowerPoint in case you would like to use the same process with your documents and presentations.
I'm trying to create a code for Excel to open a website and download/open a.CSV file from that website. I have the code to click on the file, but I can't figure out how to select 'open' or 'save' in the dialog box. The.CSV file name changes which is complicating things. My current code is below: Sub ClickDownload Dim IE As Object SitAll = 'Set IE = CreateObject('InternetExplorer.application') IE.Navigate (SitAll) IE.Visible = True Do While IE.readyState 4 'READYSTATECOMPLETE DoEvents Loop Application.Wait (Now + #12:00:10 AM#) For i = 0 To IE.Document.All.Length - 1 'lists through all elements on web page' If IE.Document.All(i).ID = 'downloadData' Then 'if anchor id is 'downloadData' IE.Document.All(i).Click 'then click on it' i = IE.Document.All.Length - 1 End If Next i End Sub Any help/tips on this would be appreciated.
Ok, here's the code tested on my Windows 7 machine with Excel 2013. This downloads the cvs file to the same folder the workbook is in and gives it a name of yyyymmdd hhmmss.csv (so 20121.csv for example. You have just accidentally stepped into a dark tunnel in a foggy swamp filled with snakes and tigers and i'm pretty sure there's a grue in there.
Seems like this should be a simple thing to do, but nay. Oh, yes sorry so you're actually going out to the windows API to do this so you'll need.