473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

using VBA to copy xls file from online source

MMcCarthy
14,534 Expert Mod 8TB
Hi everyone,

I need to copy an excel downloadable file from an online source and was wondering if anyone can guide me on this. The file I need is online as an xls file. Clicking on the link prompts a download/save. I am using VBA through Excel on this.

Mary
Aug 19 '07 #1
5 4572
ADezii
8,834 Expert 8TB
Hi everyone,

I need to copy an excel downloadable file from an online source and was wondering if anyone can guide me on this. The file I need is online as an xls file. Clicking on the link prompts a download/save. I am using VBA through Excel on this.

Mary
You may want to look into the Microsoft Internet Transfer Control. I have it on my system as an Insertable ActiveX Control, but I have never used it, and do not know much about the Control. I can at least provide a little background information about the Control, and you can look into it further if you think it suits your needs.

The Internet Transfer Control allows you to implement 2 of the most widely used Protocols on the Internet, HyperText Transfer Protocol (HTTP) and File Transfer Protocol (FTP).

With HTTP, this Control allows you to connect to World Wide Web Servers to retrieve HTML Documents. With the FTP Protocol, you can log on to FTP Servers to download/upload files. The UserName and Password Properties allow you to also log on to private Servers that require authentication. You can also connect to public FTP Servers and download files.

Common FTP commands, such as CD and GET, are supported via the Execute Method of this Control. It seems as though it may have the programmatic interface to accomplish what you are looking for, but only you'll know that once you look at it. Good luck and let me know how you make out.
Aug 20 '07 #2
MMcCarthy
14,534 Expert Mod 8TB
I'm getting the old you don't have a licence message. Can you remember how to get around that.
Aug 20 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
I'm getting the old you don't have a licence message. Can you remember how to get around that.
Thanks for looking at this. I've actually found a very simple way of doing this.

Expand|Select|Wrap|Line Numbers
  1. Dim wb As Workbook
  2.  
  3.     Set wb = Workbooks.Open("http://www.apxgroup.com/marketdata/gasuk/xls/ukwdbm_sapsmp_data.xls")
  4.     wb.SaveCopyAs "C:\Path\ukwdbm_sapsmp_data.xls"
  5.     Workbooks.Close
  6.  
If anybody has a nicer method I'll be glad of any suggestions but this one seems to work fine.
Aug 20 '07 #4
ADezii
8,834 Expert 8TB
Thanks for looking at this. I've actually found a very simple way of doing this.

Expand|Select|Wrap|Line Numbers
  1. Dim wb As Workbook
  2.  
  3.     Set wb = Workbooks.Open("http://www.apxgroup.com/marketdata/gasuk/xls/ukwdbm_sapsmp_data.xls")
  4.     wb.SaveCopyAs "C:\Path\ukwdbm_sapsmp_data.xls"
  5.     Workbooks.Close
  6.  
If anybody has a nicer method I'll be glad of any suggestions but this one seems to work fine.
I don't think you can get much simpler and cleaner than that, Mary. Sorry for going off on a tangent, I was under the assumption that you wanted to automate the process of downloading a file from an online source onto your HD. I have this unique tendency to over-complicate things. See you around.
Aug 20 '07 #5
MMcCarthy
14,534 Expert Mod 8TB
I don't think you can get much simpler and cleaner than that, Mary. Sorry for going off on a tangent, I was under the assumption that you wanted to automate the process of downloading a file from an online source onto your HD. I have this unique tendency to over-complicate things. See you around.
Not a problem. I probably didn't explain myself very well. Newbie error :)
Aug 20 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Phil Powell | last post by:
I've read some online resources that utilize various MySQL command-line actions to migrate data from Access to MySQL. The situation is this: a group of co-workers of mine will be using an Access...
4
by: NohaKhalifa | last post by:
Dear All; I'm developing a web site and i need to make adminisration for this site it's a site for Real Estates . But I don't need the administration to be online .. I want them to fill data...
24
by: Christopher Benson-Manica | last post by:
Is there anything wrong with my attempt (below) at implementing something resembling a smart pointer? template < class T > class SmartPointer { private: T *t; public:
4
by: Gactimus | last post by:
Here is a program that encodes and decodes a text file. What I need to do is write a C++ program that requests 3 different file names. One filename is for the source file to be encoded, another is...
1
by: Aliza Klein | last post by:
Hi. A client of mine has a website with a standard "Contact Us" form page with name, address etc. The information is currently sent via email to the client and is then data entered into their...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
1
by: PRM | last post by:
Hi I have an ASp.net application using C#. I need to copy a file present on the web server machine to a remote machine on the network. Although this seems to be a trivial matter I am having...
6
by: sql_server_user | last post by:
I'm trying to copy all 440 million rows from one table in my SQL Server 2005 db to another table with a different clustering scheme. After a few test inserts that were successful (up to a million...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.