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. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
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
-
Trump signs Take It Down Act
by
Alex5723
7 hours, 19 minutes ago -
Do you have a maintenance window?
by
Susan Bradley
7 hours, 45 minutes ago -
Freshly discovered bug in OpenPGP.js undermines whole point of encrypted comms
by
Nibbled To Death By Ducks
8 hours, 53 minutes ago -
Success Knows No End in the World of Online Slots (Awaiting moderation)
by
isobelhartmann1
9 hours, 2 minutes ago -
Cox Communications and Charter Communications to merge
by
not so anon
10 hours, 39 minutes ago -
Help with WD usb driver on Windows 11
by
Tex265
15 hours, 49 minutes ago -
hibernate activation
by
e_belmont
19 hours, 34 minutes ago -
Red Hat Enterprise Linux 10 with AI assistant
by
Alex5723
23 hours, 22 minutes ago -
Windows 11 Insider Preview build 26200.5603 released to DEV
by
joep517
1 day, 2 hours ago -
Windows 11 Insider Preview build 26120.4151 (24H2) released to BETA
by
joep517
1 day, 2 hours ago -
Fixing Windows 24H2 failed KB5058411 install
by
Alex5723
34 minutes ago -
Out of band for Windows 10
by
Susan Bradley
1 day, 7 hours ago -
Giving UniGetUi a test run.
by
RetiredGeek
1 day, 14 hours ago -
Windows 11 Insider Preview Build 26100.4188 (24H2) released to Release Preview
by
joep517
1 day, 21 hours ago -
Microsoft is now putting quantum encryption in Windows builds
by
Alex5723
7 hours, 49 minutes ago -
Auto Time Zone Adjustment
by
wadeer
2 days, 2 hours ago -
To download Win 11 Pro 23H2 ISO.
by
Eddieloh
1 day, 23 hours ago -
Manage your browsing experience with Edge
by
Mary Branscombe
41 minutes ago -
Fewer vulnerabilities, larger updates
by
Susan Bradley
16 hours, 56 minutes ago -
Hobbies — There’s free software for that!
by
Deanna McElveen
23 hours, 20 minutes ago -
Apps included with macOS
by
Will Fastie
21 hours, 12 minutes ago -
Xfinity home internet
by
MrJimPhelps
17 hours, 59 minutes ago -
Convert PowerPoint presentation to Impress
by
RetiredGeek
1 day, 19 hours ago -
Debian 12.11 released
by
Alex5723
2 days, 23 hours ago -
Microsoft: Troubleshoot problems updating Windows
by
Alex5723
3 days, 3 hours ago -
Woman Files for Divorce After ChatGPT “Reads” Husband’s Coffee Cup
by
Alex5723
2 days, 6 hours ago -
Moving fwd, Win 11 Pro,, which is best? Lenovo refurb
by
Deo
10 hours, 10 minutes ago -
DBOS Advanced Network Analysis
by
Kathy Stevens
3 days, 20 hours ago -
Microsoft Edge Launching Automatically?
by
healeyinpa
3 days, 10 hours ago -
Google Chrome to block admin-level browser launches for better security
by
Alex5723
1 day, 8 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.