ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I get series of files to open from same folder (https://www.excelbanter.com/excel-programming/274638-how-do-i-get-series-files-open-same-folder.html)

Ron McCormick[_2_]

How do I get series of files to open from same folder
 
I raised a query similar to this before and was given some
code along the follwoing lines:

Workbooks.Open FileName:=ThisWorkbook.Path
& "\userfile.xls"

The difference this time I am wanting to open a series of
files from the given folder. Any help would be
appreciated.

TIA
Ron



John Wilson

How do I get series of files to open from same folder
 
Ron,

You'd have to open them sequentially, using the same coding
that you were given:

Workbooks.Open FileName:=ThisWorkbook.Path & "\file1.xls"
Workbooks.Open FileName:=ThisWorkbook.Path & "\file2.xls"
Workbooks.Open FileName:=ThisWorkbook.Path & "\file3.xls"

Another option would be to save the open workbooks as a "Workspace"
Then whenever you open the workspace, all the files in the workspace
will be opened together.

John


Ron McCormick wrote:

I raised a query similar to this before and was given some
code along the follwoing lines:

Workbooks.Open FileName:=ThisWorkbook.Path
& "\userfile.xls"

The difference this time I am wanting to open a series of
files from the given folder. Any help would be
appreciated.

TIA
Ron



Tom Ogilvy

How do I get series of files to open from same folder
 
How would we determine the series. Do you want to open all the files in
the folder, or those meeting certain criteria in terms of their name.

In any event, look at the sample for the Dir command in VBA. That is a good
start.

--
Regards,
Tom Ogilvy


"Ron McCormick" wrote in message
...
I raised a query similar to this before and was given some
code along the follwoing lines:

Workbooks.Open FileName:=ThisWorkbook.Path
& "\userfile.xls"

The difference this time I am wanting to open a series of
files from the given folder. Any help would be
appreciated.

TIA
Ron






All times are GMT +1. The time now is 07:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com