Hi all

Thanks for this excellent resource, it has been of great assistance to me, but I am having a problem using excel VBA to download excel files from a remote server. I suspect it is something obvious that my code is lacking.

The purpose of the Updates Program workbook, attached, is to cycle through downloading files from a remote server, add new work done to them, the downloaded files have formulas which compare the cost of work done against budget, the UTest3.xlsUpdates Program.xlsxAttachment 230504Attachment 230505pdates Program workbook will then record the updated % of costs of work done against budget on the "Details" worksheet so I can flag any which risk going over budget.

The "Controls" worksheet currently has various URLs on which can be ignored. These are simply left over from my manifold attempts to get this to work.

The problem I am having is that all the downloaded files are always 15KB in size, regardless of the size or content of the original file and all bear the same content which appears to be simply copied from the host website, a sample of which is also attached called "Test3". I have tried using various file extensions including CSV but the results are the same.

When I open the downloaded file excel says the file format and extension don't match and then says that, due to problems during load, the file is "missing file C:\remote\css\logon.css" and "missing file C:\remote\javascript\ramjsfx.menu.css", which is Greek to me.

The URL to get to the folder is "https://remote.picosting.co.uk/Remote/fs/files.aspx?path=%5c%5cPISBS2011%5cfiles%5cRob%20Shaw's%20test%20folder". I used "https://remote.picosting.co.uk/Remote/fs/files.aspx?path=%5c%5cPISBS2011%5cfiles%5cRob%20Shaw's%20test%20folder%5cTest1" to download the attached Test3 file.

The subject macro is called "DownloadFilefromWeb" and is in module 4. The "Download file" button runs the subject macro:

Please Login or Register  to view this content.
I would be grateful for any assistance.

Kind regards

Rob