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
-
24H2 Installer – don’t see ption for non distructive install
by
JP
2 minutes ago -
Asking Again here (New User and Fast change only backups)
by
thymej
10 hours, 57 minutes ago -
How much I spent on the Mac mini
by
Will Fastie
24 minutes ago -
How to get rid of Copilot in Microsoft 365
by
Lance Whitney
2 hours, 45 minutes ago -
Spring cleanup — 2025
by
Deanna McElveen
16 hours, 49 minutes ago -
Setting up Windows 11
by
Susan Bradley
25 minutes ago -
VLC Introduces Cutting-Edge AI Subtitling and Translation Capabilities
by
Alex5723
12 hours, 17 minutes ago -
Powershell version?
by
CWBillow
13 hours, 10 minutes ago -
SendTom Toys
by
CWBillow
7 hours, 50 minutes ago -
Add shortcut to taskbar?
by
CWBillow
17 hours, 5 minutes ago -
Sycophancy in GPT-4o: What happened
by
Alex5723
1 day, 9 hours ago -
How can I install Skype on Windows 7?
by
Help
1 day, 8 hours ago -
Logitech MK850 Keyboard issues
by
Rush2112
15 hours, 5 minutes ago -
We live in a simulation
by
Alex5723
1 day, 23 hours ago -
Netplwiz not working
by
RetiredGeek
1 day, 10 hours ago -
Windows 11 24H2 is broadly available
by
Alex5723
2 days, 12 hours ago -
Microsoft is killing Authenticator
by
Alex5723
23 hours, 39 minutes ago -
Downloads folder location
by
CWBillow
2 days, 18 hours ago -
Remove a User from Login screen
by
CWBillow
1 day, 14 hours ago -
TikTok fined €530 million for sending European user data to China
by
Nibbled To Death By Ducks
2 days, 9 hours ago -
Microsoft Speech Recognition Service Error Code 1002
by
stanhutchings
2 days, 9 hours ago -
Is it a bug or is it expected?
by
Susan Bradley
11 hours, 44 minutes ago -
Image for Windows TBwinRE image not enough space on target location
by
bobolink
2 days, 8 hours ago -
Start menu jump lists for some apps might not work as expected on Windows 10
by
Susan Bradley
1 day, 8 hours ago -
Malicious Go Modules disk-wiping malware
by
Alex5723
2 days, 22 hours ago -
Multiple Partitions?
by
CWBillow
2 days, 23 hours ago -
World Passkey Day 2025
by
Alex5723
19 hours, 16 minutes ago -
Add serial device in Windows 11
by
Theodore Dawson
4 days, 7 hours ago -
Windows 11 users reportedly losing data due forced BitLocker encryption
by
Alex5723
2 days, 8 hours ago -
Cached credentials is not a new bug
by
Susan Bradley
4 days, 12 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.