Based on data entered by a user, I can develop the http: address of a file that I need to download from a website. It looks like the FollowHyperlink method will download the file based on the address I pass to it. However, it does not allow me to specify where tdhe file is stored and it also looks like it will try to launch the file using the application that the file extension indicates should be used. I need to have the file stored in a specific folder where my code can manipulate it and I do not want it launched. Is there some other method that will do this?
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
FollowHyperlink (Excel 2003 VBA)
Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » FollowHyperlink (Excel 2003 VBA)
- This topic has 13 replies, 4 voices, and was last updated 16 years, 9 months ago.
AuthorTopicH. Legare Coleman
AskWoody PlusJuly 30, 2008 at 1:23 pm #452830Viewing 0 reply threadsAuthorReplies-
WSHansV
AskWoody LoungerJuly 30, 2008 at 6:28 pm #1119008FollowHyperlink downloads a file to your browser cache, then opens it. You could save the file to the desired location after it has been opened.
Alternatively, you can use the code from Download File Using HTTP to download the file to the desired location.
Note: on my PC, Microsoft Internet Transfer Control wasn’t listed in Tools | References, so I had to browse for C:WindowsSystem32msinet.ocx. The code worked in a small test (I downloaded an attachment to a post in the Excel forum) -
H. Legare Coleman
AskWoody PlusJuly 31, 2008 at 3:19 am #1119055Thanks. However, I have just had to buy a new computer and much to my dislike the new one came with VISTA Home Premimum installed. From what I can find out by searching the MS web site, MSINET.OCX does not come with VISTA, and I can’t find where it was replaced with something else. It also looks like the old MSINET.OCX can not be installed on VISTA.
-
WSHansV
AskWoody LoungerJuly 31, 2008 at 4:20 am #1119065I have attached a zipped workbook that contains code using the Wininet.dll file that comes with Internet Explorer, I assume that it’s available on Windows Vista too.
The class module HTTP in the workbook is derived from Modules: Internet Data Transfer Library on the Access Web. I removed Access-specific elements and unused code.The procedure to use is DownloadFile, see TestDownload for an example of its use:
Sub TestDownload()
DownloadFile “http://www.mvps.org/access/acknowledge.htm”, “C:test.htm”
End SubI hope that this works on Vista.
-
H. Legare Coleman
AskWoody Plus -
H. Legare Coleman
AskWoody PlusAugust 1, 2008 at 6:08 am #1119232I thought that was going to work. I tested it by downloading a .xls file from here in the lounge and everything went perfectly. However, when I tried it on the real file that I need to download (a 23meg .mpg file), the file I ended up with was 12kb. I didn’t get any reported error. Do you know if there is some limit on what can be downloaded using this?
-
WSHansV
AskWoody LoungerAugust 1, 2008 at 6:30 am #1119233I successfully downloaded a 21 MB video using the code, so it works for large files too.
Two things to look out for:
– Make sure that you have an URL that points to the file that you want to download, not to the web page that contains the download link.
– Make sure that the file can actually be downloaded – if it’s provided as streaming video that may not be possible. -
H. Legare Coleman
AskWoody PlusAugust 1, 2008 at 7:27 am #1119238OK, I think I see the problem. The download is from a proprietary site which I have to log onto before I can download the files. I thought that, if I was currently logged onto the site in IE, then I could use this to download the files.. However, it looks like the 12kb file is actually the HTML for a logon page. Any way around that.
-
WSHansV
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSStuartR
AskWoody LoungerAugust 1, 2008 at 10:13 am #1119249According to this MSDN article, you specify the username and password as parameters to the Wininet internetconnect call.
StuartR
-
H. Legare Coleman
AskWoody Plus -
WSStuartR
AskWoody LoungerAugust 2, 2008 at 10:23 pm #1119479Here is an example of how to declare InternetConnect from Visual Basic. This site also has examples of many other Wininet calls
Here is an example of using all the Wininet API calls in sequence (but not from VB)
Here is an example of logging in to an ftp server and fetching a single file from an ftp server in VB.StuartR
-
macropod
AskWoody_MVPAugust 2, 2008 at 7:20 pm #1119462Hi Legare,
Perhaps this: http://www.tek-tips.com/faqs.cfm?fid=6400%5B/url%5D might be useful.
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
-
-
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Trying to backup Win 10 computer to iCloud (Awaiting moderation)
by
SheltieMom
13 seconds ago -
Windows 11 Insider Preview build 26200.5570 released to DEV
by
joep517
6 hours, 36 minutes ago -
Windows 11 Insider Preview build 26120.3941 (24H2) released to BETA
by
joep517
8 hours, 24 minutes ago -
Windows 11 Insider Preview Build 22635.5305 (23H2) released to BETA
by
joep517
8 hours, 26 minutes ago -
No April cumulative update for Win 11 23H2?
by
Peobody
10 hours, 44 minutes ago -
AugLoop.All (TEST Augmentation Loop MSIT)
by
LarryK
8 hours, 57 minutes ago -
Boot Sequence for Dell Optiplex 7070 Tower
by
Serge Carniol
1 day ago -
OTT Upgrade Windows 11 to 24H2 on Unsupported Hardware
by
bbearren
1 day, 3 hours ago -
Inetpub can be tricked
by
Susan Bradley
1 day, 4 hours ago -
How merge Outlook 2016 .pst file w/into newly created Outlook 2024 install .pst?
by
Tex265
8 hours, 17 minutes ago -
FBI 2024 Internet Crime Report
by
Alex5723
1 day, 7 hours ago -
Perplexity CEO says its browser will track everything users do online
by
Alex5723
19 hours, 9 minutes ago -
Login issues with Windows Hello
by
CWBillow
1 day, 18 hours ago -
How to get into a manual setup screen in 2024 Outlook classic?
by
Tex265
1 day, 6 hours ago -
Linux : ARMO rootkit “Curing”
by
Alex5723
2 days, 6 hours ago -
Employee monitoring app leaks 21 million screenshots in real time
by
Alex5723
2 days, 6 hours ago -
Google AI is now hallucinating idioms
by
Alex5723
2 days, 6 hours ago -
april update
by
69800
10 hours, 57 minutes ago -
Windows 11 Insider Preview build 27842 released to Canary
by
joep517
2 days, 7 hours ago -
Quick Fix for Slowing File Explorer
by
Drcard:))
2 days, 7 hours ago -
WuMgr not loading?
by
LHiggins
1 day, 3 hours ago -
Word crashes when accessing Help
by
CWBillow
1 day, 11 hours ago -
New Microsoft Nag — Danger! Danger! sign-in to your Microsoft Account
by
EricB
2 days, 7 hours ago -
Blank Inetpub folder
by
Susan Bradley
2 days, 4 hours ago -
Google : Extended Repair Program for Pixel 7a
by
Alex5723
2 days, 17 hours ago -
Updates seem to have broken Microsoft Edge
by
rebop2020
2 days, 4 hours ago -
Wait command?
by
CWBillow
2 days, 11 hours ago -
Malwarebytes 5 Free version manual platform updates
by
Bob99
3 days ago -
inetpub : Microsoft’s patch for CVE-2025–21204 introduces vulnerability
by
Alex5723
3 days, 7 hours ago -
Windows 10 finally gets fix
by
Susan Bradley
3 days, 16 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.