Solved

Please advice

Posted on 2011-02-15
4
231 Views
Last Modified: 2012-05-11
I want to check a excell sheet which reside under a folder like C:/Temp/2/14/11/test.xls for February 14th file and like C:/Temp/02/15/11/test.xls. for Feb 15th file and so on....
Please advice me the VBA code to read the file everyday to check.

Your prompt response would be highly appreciated.
0
Comment
Question by:alam747
  • 2
4 Comments
 
LVL 46

Accepted Solution

by:
tbsgadi earned 500 total points
ID: 34904346
Something like this:
Gary
Dim ObjEx As Excel.Application
Set ObjEx = New Excel.Application

With ObjEx

       .Workbooks.Open FileName:="C:/Temp/" & Format(Date, "m/dd/yy") & "/test.xls"
end with

...

Open in new window

0
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 34908012
I also recommend changing the format to C:/Temp/2011/02/14/test.xls so that the sorting will make sense and all the data will be grouped into folders by year. The way you have it currently, the folders will be grouped in very strange ways.

The yyyy/mm/dd format is what most people in industry use for filenames and paths.
0
 

Author Closing Comment

by:alam747
ID: 34908847
Thanks a lot , it helps
0
 
LVL 46

Expert Comment

by:tbsgadi
ID: 34908984
Glad to help!
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

This very simple solution applies to a narrow cross-section of the "needs to close" variety. In this case, the full message in Event Viewer was in applog, Event ID 1000: Faulting application iexplore.exe, version 8.0.6001.18702, faulting module …
This collection of functions covers all the normal rounding methods of just about any numeric value.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now