VBA Developer
The following function uses the URLDownloadToFile Lib "urlmon" to download a .jpg file from a website. This works perfectly in Windows XP but is not working with Windows 7. Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean Dim lngRetVal As Long lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0) If lngRetVal = 0 Then DownloadFile = True End Function I have found no definitive answer on the internet. What am I missing???
July 13th, 2012 3:42pm

Try developer forum, please. Thank for understanding. Milos
Free Windows Admin Tool Kit Click here and download it now
July 13th, 2012 5:51pm

1. Function URLDownloadToFile has been developed with VB6 in the Windows XP environment. Support of VB6 itself continues to Windows 7 and 8. Look for exceptions and special aspects of using VB6 in latest and coming operating systems: http://msdn.microsoft.com/nb-no/vbrun/ms788708(en-us).aspx I would add printouts and breakpoints into the original URLDownloadToFile source and test, where is problem. http://vbnet.mvps.org/index.html?code/internet/urldownloadtofile.htm 2. Another aspect of difference between Windows XP and Windows 7 is additional security level ana some executives should be run with elevated right. UAC plays the role too. 3. You can analyze what happens with Process Monitor, but this is last resort when nothing helped. Regards Milos
July 14th, 2012 5:01am

1. Function URLDownloadToFile has been developed with VB6 in the Windows XP environment. Support of VB6 itself continues to Windows 7 and 8. Look for exceptions and special aspects of using VB6 in latest and coming operating systems: http://msdn.microsoft.com/nb-no/vbrun/ms788708(en-us).aspx I would add printouts and breakpoints into the original URLDownloadToFile source and test, where is problem. http://vbnet.mvps.org/index.html?code/internet/urldownloadtofile.htm 2. Another aspect of difference between Windows XP and Windows 7 is additional security level ana some executives should be run with elevated right. UAC plays the role too. 3. You can analyze what happens with Process Monitor, but this is last resort when nothing helped. Regards Milos
Free Windows Admin Tool Kit Click here and download it now
July 14th, 2012 5:09am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics