VBA Express
download file [Archive] - VBA Express Forum

PDA

View Full Version : download file



vzachin
04-28-2010, 04:47 PM
hi,

i have an excel file that i retrieve from an internal website. the url is about 1300 characters long.

i tried something like this but it doesn't work. i get a Run-time error 1004; Method 'Open' of object 'Workbooks' failed
i have tried similar code which worked but this one does not.

Sub DownLoadFileTest()
Dim file As String
file = Range("a5")
Workbooks.Open Filename:=file
End Sub

the way i usually access this excel file is to go to the internal website, enter a few criterias and then click on a button to download an excel file. i want to try to automate this.

if i manually copy and paste the url into the address bar, it works...
any ideas what i'm doing wrong.


thanks
zach