Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Business Applications Business Applications
Search Search
Search for:
Tech Support Guy > > >

macro to check for updated file


(!)

pthom14's Avatar
pthom14 pthom14 is offline
Junior Member with 6 posts.
THREAD STARTER
 
Join Date: Oct 2010
05-Oct-2010, 01:38 PM #1
macro to check for updated file
Once a month, research releases a new downloadable excel file with stock ratings. I would like to have a macro in my stock analysis worksheet that will prompt me to download the new data when I open the workbook if a new file is available. The catch is that it is a large file, and I don't want it to download until the user asks it to update. I already have the macro written to download and process the file, but it doesn't check for a newer version.

Part of the url for the file is: EC%5FUniverse%5F2010%5FSeptember%2Exls.
I would like an alert to pop up when the file called EC%5FUniverse%5F2010%5FOctober%2Exls is available. Any advice?
pthom14's Avatar
pthom14 pthom14 is offline
Junior Member with 6 posts.
THREAD STARTER
 
Join Date: Oct 2010
08-Oct-2010, 11:22 AM #2
bump
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,666 posts.
 
Join Date: Mar 2005
Location: UK
08-Oct-2010, 01:52 PM #3
pthom14, welcome to the Forum.
You should not need to try and find a Month Name embedded in the File's name. You should be able to use the File System Object to return the date the File was last Accessed or maybe the date created.
You use it like this
variable = FileDateTime(File location)
Where File location is the Folder path to where the document file is located.

You can use it in conjunction with the FileSearch object.
__________________
OBP
I do not give up easily
pthom14's Avatar
pthom14 pthom14 is offline
Junior Member with 6 posts.
THREAD STARTER
 
Join Date: Oct 2010
08-Oct-2010, 01:58 PM #4
Thanks OBP. I'm not sure this applies to what I'm trying to do. I'm trying to test if the current month's file is available for download from the Internet yet or not. I would like the macro to return true if the file is available, false otherwise. Do you know of something similar for a website?
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,666 posts.
 
Join Date: Mar 2005
Location: UK
08-Oct-2010, 02:15 PM #5
Will the older file still be there or does this one replace it?
Is the rest of the URL the same in each case?
If so you could store the URL for the current file and compare it to the one on the website.
pthom14's Avatar
pthom14 pthom14 is offline
Junior Member with 6 posts.
THREAD STARTER
 
Join Date: Oct 2010
08-Oct-2010, 03:32 PM #6
The old file no longer exists and the rest of the URL does stay the same. I know what the URL will be. How do I tell if it is available without loading the whole file?
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,666 posts.
 
Join Date: Mar 2005
Location: UK
09-Oct-2010, 02:59 AM #7
I have found this link to downloading data based on parameters in an excel sheet, perhaps that will help.
http://www.excelforum.com/excel-prog...-from-vba.html
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,666 posts.
 
Join Date: Mar 2005
Location: UK
09-Oct-2010, 03:10 AM #8
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,666 posts.
 
Join Date: Mar 2005
Location: UK
09-Oct-2010, 03:21 AM #9
I also found this which opens a web page, I would assume that if the web page does not exist you will get an error message, you could then use erro trapping to stop any attempted download.
Application.Workbooks.Open ("http://www.geocities.com/johnske100/TheFINDfunction.html")
This extrac is from this link
http://www.vbaexpress.com/kb/getarticle.php?kb_id=295
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


Tags
excel, macro, url

(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Title Thread Starter Forum Replies Last Post
Macro to Update Stock Quotes tpdjr Business Applications 0 21-May-2009 12:29 PM
can't check for update yona425 Windows Vista 1 24-Mar-2009 05:47 PM
softwares are unable to check for updates like antiviruses etc salfuser312 Web & Email 3 08-Mar-2009 12:56 PM
Macro for updating the data tables of one worksheet in workbook rashu.singh Business Applications 1 06-Nov-2008 03:13 PM
How to check for currupt files and an AOL question keenrw Windows XP 1 12-Jun-2004 01:46 AM

WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑

Content Relevant URLs by vBSEO 3.3.2