Solved

Please advice

Posted on 2011-02-15
4
232 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
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…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

867 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

15 Experts available now in Live!

Get 1:1 Help Now