Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Copy files from website?

I use Excel 2007 with VBA at work. We also have a company
website that, I believe, is an Intranet only website.

Is it possible to use VBA to extract images from our company
website and copy them to a local folder?

For example, if I type "http://blue/our_site/img/444.001.jpg" in my
Internet Explorer browser at work, an image will load on my
browser. Are there VBA functions that take a URL as above
and copy the file to a target location??

Thanks!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default Copy files from website?

Robert Crandal wrote:

I use Excel 2007 with VBA at work. We also have a company
website that, I believe, is an Intranet only website.

Is it possible to use VBA to extract images from our company
website and copy them to a local folder?

For example, if I type "http://blue/our_site/img/444.001.jpg" in my
Internet Explorer browser at work, an image will load on my
browser. Are there VBA functions that take a URL as above
and copy the file to a target location??


Does it *need* to be VBA? While VBA certainly can do it, it's much simpler to
use a download manager like wget or curl from the command line:
cd "local folder"
wget http://blue/our_site/img/444.001.jpg

--
You seldom learn the names of the truly wealthy and powerful.
You see only their spokesmen. The political arena makes a few
exceptions to this but does not reveal the full power structure.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Copy files from website?

I cant install "wget" or "curl" at work. I thought maybe VBA
had some functions for downloading files from a website.

"Auric__" wrote in message
44.100...
Robert Crandal wrote:

Does it *need* to be VBA? While VBA certainly can do it, it's much simpler
to
use a download manager like wget or curl from the command line:
cd "local folder"
wget http://blue/our_site/img/444.001.jpg


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default Copy files from website?

Robert Crandal wrote:

"Auric__" wrote in message
44.100...
Robert Crandal wrote:

Does it *need* to be VBA? While VBA certainly can do it, it's much simpler
to use a download manager like wget or curl from the command line:
cd "local folder"
wget http://blue/our_site/img/444.001.jpg


I cant install "wget" or "curl" at work. I thought maybe VBA
had some functions for downloading files from a website.


Well... if it was me, I'd just run wget from a USB drive... if it was me.

But since you're not me, you can try this:

Declare Function URLDownloadToFile Lib "urlmon" _
Alias "URLDownloadToFileA" (ByVal pCaller As Long, _
ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Sub grabfile()
URLDownloadToFile 0, "http://blue/our_site/img/444.001.jpg", _
"C:\dir\you\have\write\access\to\444.001.jpg", 0, 0
End Sub

If that doesn't work, there's more than one way to skin this cat. Google for
"automate internet explorer vb", without quotes.

--
In the meantime why let the worry mice gnaw at one's mind?
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Copy files from website?

Perfect, that worked very nicely for me. That's exactly what I
was looking for!

Thank you very much!


"Auric__" wrote in message
44.100...
Robert Crandal wrote:


But since you're not me, you can try this:

Declare Function URLDownloadToFile Lib "urlmon" _
Alias "URLDownloadToFileA" (ByVal pCaller As Long, _
ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As Long, ByVal lpfnCB As Long) As
Long
Sub grabfile()
URLDownloadToFile 0, "http://blue/our_site/img/444.001.jpg", _
"C:\dir\you\have\write\access\to\444.001.jpg", 0, 0
End Sub




  #6   Report Post  
Banned
 
Posts: 3
Default

Cho thuê sân khấu - Thi công lắp dựng sân khấu -LH 0907 150 220


Đạt Phương - Đơn vị chuyên cung cấp, cho thuê âm thanh - ánh sáng - cung cấp, lắp đặt sân khấu phục vụ sự kiện chuyên nghiệp. ... Chuyên thiết kế, cung cấp v* lắp đặt hệ thống thiết bị âm thanh, ánh sáng, không gian, ...sân khấu. Liên hệ Mr Đạt 0911 000 222



[center]











  #7   Report Post  
Junior Member
 
Posts: 10
Default

Huyen Tâm Bui :v. Mới chỗ vợ xong gặp trưa đ*p đấy. Gam em phá Nguyen chị M*p Thu gọi Jessica Đang đi chồng cả kêu nay Gấu ăn Gọi Nguyen Bùi về
Bảo Hiểm Chăm sóc sức khỏe
  #8   Report Post  
Junior Member
 
Posts: 1
Default

l*m bằng cấp 3
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
rewrite excell files on website Raymondo Excel Discussion (Misc queries) 1 October 28th 08 04:25 PM
Using Excel to download a batch of files from a website fugazi48 Excel Programming 1 October 18th 07 08:27 PM
Downloading excel files from a website using VBA Dileep Chandran Excel Programming 0 April 2nd 07 07:42 AM
need to upload copied excel files to admin page on website hank business market Excel Discussion (Misc queries) 1 May 22nd 06 01:42 AM
Copy from website to Excel reno Excel Programming 0 January 25th 05 08:49 PM


All times are GMT +1. The time now is 10:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"