Open File

R

ronbo

First, I would like to thank M.Tomasura for the help with
my first question. creating a macro to close files and to
all that take time to help, it is appreciated.

I now need help creating a macro to open files. I need a
macro to 1. open the "Open Dialog" box 2. insert the
file name to be opened (which changes each month) 3. copy
data (from same cells each month) 4. Paste data (to same
cells each month) 5. close the file that was opened.

I am stuck at trying to insert the file name. Workbook 1
has the file name syntax of "ABC Report Mth Yr" or "ABC
Jan 04" next month "ABC Feb 04" etc. Workbook 2
named "ABC EOM Jan 04", "ABC EOM Feb 04",etc.

So in Jan, Workbook 1 needs a macro that will insert "ABC
EOM Jan 04", in the "Name" box of the "Open Dialog" box
and open the file. Next month "ABC EOM Feb 04" etc.

Any help would be appreciated.
 
J

JE McGimpsey

Any reason you can't just open the workbook directly?

Workbooks.Open "ABC Feb 04.xls"

or

Workbooks.Open ActiveWorkbook.Path & _
Application.PathSeparator & "ABC Feb 04.xls"
 

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