PDA

View Full Version : urldownloadtofile-is-downloading-files-to-inetcache



thanis
05-12-2018, 03:57 AM
Dear All,

I am using Urldownloadtofile to download files from a link using vba. The files are automatically downloading to c:\Users\38100442\AppData\Local\Microsoft\Windows\INetCache\IE\KUQPK734 path instead of path D:\folder\ which I specified in the code. Please share your ideas to download files to D:\folder\

Regards, Albert

mancubus
05-14-2018, 05:07 AM
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" _
(ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) _
As Long


3rd argument is the local file name. insert full file name here ("D\myfolder\myfile.xlsm")

also see:
http://www.vbaexpress.com/forum/showthread.php?43015-QR-Codes-for-Excel-2003-XP