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?
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
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, 10 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
-
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer
by
WSmeyerbos
11 hours, 33 minutes ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
7 hours, 17 minutes ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
10 hours, 7 minutes ago -
Discover the Best AI Tools for Everything
by
Alex5723
10 hours, 16 minutes ago -
Edge Seems To Be Gaining Weight
by
bbearren
25 minutes ago -
Rufus is available from the MSFT Store
by
PL1
8 hours, 28 minutes ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
1 day, 11 hours ago -
KB5061768 update for Intel vPro processor
by
drmark
17 hours, 44 minutes ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
13 hours, 55 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
1 day, 7 hours ago -
Office gets current release
by
Susan Bradley
1 day, 9 hours ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
2 days, 23 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
2 days, 8 hours ago -
Stop the OneDrive defaults
by
CWBillow
3 days ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
3 days, 10 hours ago -
X Suspends Encrypted DMs
by
Alex5723
3 days, 12 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
3 days, 13 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
3 days, 13 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
3 days, 14 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
3 days, 2 hours ago -
Enabling Secureboot
by
ITguy
3 days, 9 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
3 days, 22 hours ago -
No more rounded corners??
by
CWBillow
3 days, 17 hours ago -
Android 15 and IPV6
by
Win7and10
3 days, 7 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
4 days, 10 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
4 days, 13 hours ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
4 days, 7 hours ago -
Windows Update orchestration platform to update all software
by
Alex5723
4 days, 20 hours ago -
May preview updates
by
Susan Bradley
4 days, 7 hours ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
3 days, 23 hours ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
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.