velkugan Posted November 8, 2010 Share Posted November 8, 2010 Hi all,I have a web page contains filtered result in a table format(1 of 265 Miltiple pages).The web page has 'export to excel' option to export the entire table to excel file.When i click 'export to excel' it will start downloading the excel file, for that i need to give the location ( As usual how we downlaod any file from website).Can any one clarify me how to do this usig VBA Macro?Thanks in Advance.RegardsVelmurugan K Link to comment Share on other sites More sharing options...
Mijzelf Posted November 11, 2010 Share Posted November 11, 2010 The button where you clink on is possibly just a hyperlink. When you know the hyperlink, you could use an XmlHTTPObject to download the file. I can't program in VBA (ridiculous syntax), but in javascript it could be somthing like this:xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");xmlhttp.open( "GET", "http://full.url.to/excel.document", false );xmlhttp.send();fso = new ActiveXObject("Scripting.FileSystemObject");file = fso.CreateTextFile("C:\\Path\\To\\Desired\\excel.document");file.Write(xmlhttp.responseText);I didn't test it. I think it only works when the excel sheet is actually a csv file. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now