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
-
Are manuals extinct?
by
Susan Bradley
32 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
3 hours, 41 minutes ago -
Network Issue
by
Casey H
10 hours, 13 minutes ago -
Fedora Linux is now an official WSL distro
by
Alex5723
15 hours, 41 minutes ago -
May 2025 Office non-Security updates
by
PKCano
16 hours, 7 minutes ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
18 hours, 2 minutes ago -
pages print on restart (Win 11 23H2)
by
cyraxote
17 hours, 18 minutes ago -
Windows 11 Insider Preview build 26200.5581 released to DEV
by
joep517
20 hours, 14 minutes ago -
Windows 11 Insider Preview build 26120.3950 (24H2) released to BETA
by
joep517
20 hours, 15 minutes ago -
Proton to drop prices after ruling against “Apple tax”
by
Cybertooth
1 day, 3 hours ago -
24H2 Installer – don’t see Option for non destructive install
by
JP
11 hours, 59 minutes ago -
Asking Again here (New User and Fast change only backups)
by
thymej
1 day, 14 hours ago -
How much I spent on the Mac mini
by
Will Fastie
14 hours, 23 minutes ago -
How to get rid of Copilot in Microsoft 365
by
Lance Whitney
9 hours, 33 minutes ago -
Spring cleanup — 2025
by
Deanna McElveen
1 day, 20 hours ago -
Setting up Windows 11
by
Susan Bradley
15 hours, 53 minutes ago -
VLC Introduces Cutting-Edge AI Subtitling and Translation Capabilities
by
Alex5723
1 day, 16 hours ago -
Powershell version?
by
CWBillow
1 day, 17 hours ago -
SendTom Toys
by
CWBillow
4 hours, 2 minutes ago -
Add shortcut to taskbar?
by
CWBillow
1 day, 21 hours ago -
Sycophancy in GPT-4o: What happened
by
Alex5723
2 days, 13 hours ago -
How can I install Skype on Windows 7?
by
Help
2 days, 12 hours ago -
Logitech MK850 Keyboard issues
by
Rush2112
1 day, 19 hours ago -
We live in a simulation
by
Alex5723
3 days, 3 hours ago -
Netplwiz not working
by
RetiredGeek
2 days, 14 hours ago -
Windows 11 24H2 is broadly available
by
Alex5723
3 days, 16 hours ago -
Microsoft is killing Authenticator
by
Alex5723
17 hours, 53 minutes ago -
Downloads folder location
by
CWBillow
3 days, 22 hours ago -
Remove a User from Login screen
by
CWBillow
2 days, 18 hours ago -
TikTok fined €530 million for sending European user data to China
by
Nibbled To Death By Ducks
3 days, 13 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.