Open a Workbook using VB

C

cellist

Running EXCEL 2003.

I have an application that the user launches by opening a saved workspace
(.xlw). The saved workspace includes three related workbooks, all loaded from
fixed locations. A fourth workbook is needed, but its location is based on
the current date. I'd rather not rely on the user to figure out which
instance of the workbook to open. Can I run VB code that will figure out the
correct pathname and dynamically open the fourth workbook?

TIA,

Phil
 
J

Joel

you didn't supply a lot of description of what you wanted.

Folder = "c:\temp\"
MyDate = format(now(),"MM_DD_YYYY")
FName = Folder & MyDate
set bk = workbooks.open(filename:=FName)
 
C

cellist

Joel,

Thanks for the info. You've answered my question, even though...
you didn't supply a lot of description of what you wanted.

That's true, I didn't supply much. My question was "in general", rather than
one of "how do I determine the file/path name based on the current date?". I
know how to do that, but did not know -- until you described how -- to use
that pathname, or whether I even could use it.

Now I know!

Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top