ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   open several workbooks at the same time (https://www.excelbanter.com/excel-programming/443108-open-several-workbooks-same-time.html)

Johnnyboy5

open several workbooks at the same time
 
I would like to repeatly open the same workbooks at the same time just
by selecting just one book and the other three or four will open with
it.

thanks everyone

Per Jessen[_2_]

open several workbooks at the same time
 
Use this simple event code, just remember to insert it into the
codesheet ThisWorkbook in the first workbook you open.

Private Sub Workbook_Open()
Workbooks.Open ("Book2.xls") ' Change as required
Workbooks.Open ("Book3.xls")
Workbooks.Open ("Book4.xls")
End Sub

Regards,
Per

On 5 Jun., 18:47, Johnnyboy5 wrote:
I would like to repeatly open the same workbooks at the same time just
by selecting just one book and the other three or four will open with
it.

thanks *everyone



Gord Dibben

open several workbooks at the same time
 
See help on saving a set of files as a workspace.

Basics are.............open your 3 or 4 workbooks.

ViewSave Workspace.

Default name is resume...........extension .xlw

Give your workspace whatever name you like and save.

I will use mywkspace

Now close all workbooks.

Open mywkspace.xlw and all books will open.


Gord Dibben MS Excel MVP

On Sat, 5 Jun 2010 09:47:35 -0700 (PDT), Johnnyboy5
wrote:

I would like to repeatly open the same workbooks at the same time just
by selecting just one book and the other three or four will open with
it.

thanks everyone



Johnnyboy5[_2_]

open several workbooks at the same time
 
On 5 June, 17:56, Per Jessen wrote:
Use this simple event code, just remember to insert it into the
codesheet ThisWorkbook in the first workbook you open.

Private Sub Workbook_Open()
Workbooks.Open ("Book2.xls") ' Change as required
Workbooks.Open ("Book3.xls")
Workbooks.Open ("Book4.xls")
End Sub

Regards,
Per

On 5 Jun., 18:47, Johnnyboy5 wrote:



I would like to repeatly open the same workbooks at the same time just
by selecting just one book and the other three or four will open with
it.


thanks *everyone


Hi

cant get it to work ? is the "codesheet" the same as a macro ?

johnnyboy

Johnnyboy5[_2_]

open several workbooks at the same time
 
On 5 June, 18:05, Gord Dibben <gorddibbATshawDOTca wrote:
See help on saving a set of files as a workspace.

Basics are.............open your 3 or 4 workbooks.

ViewSave Workspace.

Default name is resume...........extension .xlw

Give your workspace whatever name you like and save.

I will use *mywkspace

Now close all workbooks.

Open mywkspace.xlw *and all books will open.

Gord Dibben *MS Excel MVP

On Sat, 5 Jun 2010 09:47:35 -0700 (PDT), Johnnyboy5



wrote:
I would like to repeatly open the same workbooks at the same time just
by selecting just one book and the other three or four will open with
it.


thanks *everyone


Thanks kind of works, but I would like each workbook (4 of them) to
appear as tabs at the bottom)

oh I am using Excel 2003

Rick Rothstein

open several workbooks at the same time
 
No, the "codesheet" is not the same as a macro. A macro is placed in a
Module (Insert/Module from the VB editor's menu bar) whereas event code
(which is what the Workbook_Open procedure is) goes on a "codesheet"... in
this case, the codesheet for the workbook (because it is **workbook** event
code). When in the VB editor, look at the Project Window (it is the one with
Sheet1, Sheet1 and other stuff in it). Do you see the entry marked
ThisWorkbook? Double click it. That should have opened up the codesheet for
the workbook... copy/paste the Workbook_Open code procedure into it. Next,
save your workbook. That's it... next time you open the workbook, the
Workbook_Open code you just copy/pasted should run (assuming you have
enabled macros to run, that is).

--
Rick (MVP - Excel)



"Johnnyboy5" wrote in message
...
On 5 June, 17:56, Per Jessen wrote:
Use this simple event code, just remember to insert it into the
codesheet ThisWorkbook in the first workbook you open.

Private Sub Workbook_Open()
Workbooks.Open ("Book2.xls") ' Change as required
Workbooks.Open ("Book3.xls")
Workbooks.Open ("Book4.xls")
End Sub

Regards,
Per

On 5 Jun., 18:47, Johnnyboy5 wrote:



I would like to repeatly open the same workbooks at the same time just
by selecting just one book and the other three or four will open with
it.


thanks everyone


Hi

cant get it to work ? is the "codesheet" the same as a macro ?

johnnyboy



Gord Dibben

open several workbooks at the same time
 
2003 version.

With the workbooks open. FileSave Workspace.

To see the workbooks on the Taskbar....ToolsOptionsViewWindows in
Taskbar.


Gord

On Sat, 5 Jun 2010 10:23:22 -0700 (PDT), Johnnyboy5
wrote:

On 5 June, 18:05, Gord Dibben <gorddibbATshawDOTca wrote:
See help on saving a set of files as a workspace.

Basics are.............open your 3 or 4 workbooks.

ViewSave Workspace.

Default name is resume...........extension .xlw

Give your workspace whatever name you like and save.

I will use *mywkspace

Now close all workbooks.

Open mywkspace.xlw *and all books will open.

Gord Dibben *MS Excel MVP

On Sat, 5 Jun 2010 09:47:35 -0700 (PDT), Johnnyboy5



wrote:
I would like to repeatly open the same workbooks at the same time just
by selecting just one book and the other three or four will open with
it.


thanks *everyone


Thanks kind of works, but I would like each workbook (4 of them) to
appear as tabs at the bottom)

oh I am using Excel 2003



Johnnyboy5[_2_]

open several workbooks at the same time
 
On 6 June, 16:02, Gord Dibben <gorddibbATshawDOTca wrote:
2003 version.

With the workbooks open. *FileSave Workspace.

To see the workbooks on the Taskbar....ToolsOptionsViewWindows in
Taskbar.

Gord

On Sat, 5 Jun 2010 10:23:22 -0700 (PDT), Johnnyboy5



wrote:
On 5 June, 18:05, Gord Dibben <gorddibbATshawDOTca wrote:
See help on saving a set of files as a workspace.


Basics are.............open your 3 or 4 workbooks.


ViewSave Workspace.


Default name is resume...........extension .xlw


Give your workspace whatever name you like and save.


I will use *mywkspace


Now close all workbooks.


Open mywkspace.xlw *and all books will open.


Gord Dibben *MS Excel MVP


On Sat, 5 Jun 2010 09:47:35 -0700 (PDT), Johnnyboy5


wrote:
I would like to repeatly open the same workbooks at the same time just
by selecting just one book and the other three or four will open with
it.


thanks *everyone


Thanks kind of works, *but I would like each workbook (4 of them) to
appear as tabs at the bottom)


oh I am using Excel 2003


Thanks

John

Johnnyboy5[_2_]

open several workbooks at the same time
 
On 5 June, 21:22, "Rick Rothstein"
wrote:
No, the "codesheet" is not the same as a macro. A macro is placed in a
Module (Insert/Module from the VB editor's menu bar) whereas event code
(which is what the Workbook_Open procedure is) goes on a "codesheet"... in
this case, the codesheet for the workbook (because it is **workbook** event
code). When in the VB editor, look at the Project Window (it is the one with
Sheet1, Sheet1 and other stuff in it). Do you see the entry marked
ThisWorkbook? Double click it. That should have opened up the codesheet for
the workbook... copy/paste the Workbook_Open code procedure into it. Next,
save your workbook. That's it... next time you open the workbook, the
Workbook_Open code you just copy/pasted should run (assuming you have
enabled macros to run, that is).

--
Rick (MVP - Excel)

"Johnnyboy5" wrote in message

...



On 5 June, 17:56, Per Jessen wrote:
Use this simple event code, just remember to insert it into the
codesheet ThisWorkbook in the first workbook you open.


Private Sub Workbook_Open()
Workbooks.Open ("Book2.xls") ' Change as required
Workbooks.Open ("Book3.xls")
Workbooks.Open ("Book4.xls")
End Sub


Regards,
Per


On 5 Jun., 18:47, Johnnyboy5 wrote:


I would like to repeatly open the same workbooks at the same time just
by selecting just one book and the other three or four will open with
it.


thanks *everyone


Hi


cant get it to work ? *is the "codesheet" the same as a macro ?


johnnyboy


Thnaks Rick - Think I have got it now, one last question how do I
keep the "main" workbook open and the others are open but as tabs at
the bottom, just right now the last workbook in the list that is
opened is the one that is presented in Excel and the others including
the "main sheet" are open as Tabs.

Many thanks for your time. Johhny


Johnnyboy5[_2_]

open several workbooks at the same time
 
On 6 June, 22:37, Johnnyboy5 wrote:
On 5 June, 21:22, "Rick Rothstein"





wrote:
No, the "codesheet" is not the same as a macro. A macro is placed in a
Module (Insert/Module from the VB editor's menu bar) whereas event code
(which is what the Workbook_Open procedure is) goes on a "codesheet"... in
this case, the codesheet for the workbook (because it is **workbook** event
code). When in the VB editor, look at the Project Window (it is the one with
Sheet1, Sheet1 and other stuff in it). Do you see the entry marked
ThisWorkbook? Double click it. That should have opened up the codesheet for
the workbook... copy/paste the Workbook_Open code procedure into it. Next,
save your workbook. That's it... next time you open the workbook, the
Workbook_Open code you just copy/pasted should run (assuming you have
enabled macros to run, that is).


--
Rick (MVP - Excel)


"Johnnyboy5" wrote in message


....


On 5 June, 17:56, Per Jessen wrote:
Use this simple event code, just remember to insert it into the
codesheet ThisWorkbook in the first workbook you open.


Private Sub Workbook_Open()
Workbooks.Open ("Book2.xls") ' Change as required
Workbooks.Open ("Book3.xls")
Workbooks.Open ("Book4.xls")
End Sub


Regards,
Per


On 5 Jun., 18:47, Johnnyboy5 wrote:


I would like to repeatly open the same workbooks at the same time just
by selecting just one book and the other three or four will open with
it.


thanks *everyone


Hi


cant get it to work ? *is the "codesheet" the same as a macro ?


johnnyboy


Thnaks Rick - Think I have got it now, *one last question how do I
keep the "main" workbook open and the others are open but as tabs at
the bottom, *just right now the last workbook in the list that is
opened is the one that is presented in Excel and the others including
the "main sheet" are open as Tabs.

Many thanks for your time. *Johhny


Hi

just sorted it, I added the "main" sheets name to the bottom of the
workbook list and it goes there after the others have also loaded

work like a dream... many thanks

Johnny

Johnnyboy5[_2_]

open several workbooks at the same time
 
On 5 June, 21:22, "Rick Rothstein"
wrote:
No, the "codesheet" is not the same as a macro. A macro is placed in a
Module (Insert/Module from the VB editor's menu bar) whereas event code
(which is what the Workbook_Open procedure is) goes on a "codesheet"... in
this case, the codesheet for the workbook (because it is **workbook** event
code). When in the VB editor, look at the Project Window (it is the one with
Sheet1, Sheet1 and other stuff in it). Do you see the entry marked
ThisWorkbook? Double click it. That should have opened up the codesheet for
the workbook... copy/paste the Workbook_Open code procedure into it. Next,
save your workbook. That's it... next time you open the workbook, the
Workbook_Open code you just copy/pasted should run (assuming you have
enabled macros to run, that is).

--
Rick (MVP - Excel)

"Johnnyboy5" wrote in message

...



On 5 June, 17:56, Per Jessen wrote:
Use this simple event code, just remember to insert it into the
codesheet ThisWorkbook in the first workbook you open.


Private Sub Workbook_Open()
Workbooks.Open ("Book2.xls") ' Change as required
Workbooks.Open ("Book3.xls")
Workbooks.Open ("Book4.xls")
End Sub


Regards,
Per


On 5 Jun., 18:47, Johnnyboy5 wrote:


I would like to repeatly open the same workbooks at the same time just
by selecting just one book and the other three or four will open with
it.


thanks *everyone


Hi


cant get it to work ? *is the "codesheet" the same as a macro ?


johnnyboy- Hide quoted text -


- Show quoted text -


HI

just pluged in my pen stick into my works PC and it wont open the
files - coz the file drive at work is called e.g F: at home its
called G:

so the workbooks dont get found unless I manually change the drive in
the code text

hope this makes sense.

example Workbooks.Open ("F:\Direct Payments DOT\0.5 yearly payment
planner.xls")

Johhny

Rick Rothstein

open several workbooks at the same time
 
just pluged in my pen stick into my works PC and it wont open the
files - coz the file drive at work is called e.g F: at home its
called G:

so the workbooks dont get found unless I manually change the drive in
the code text

hope this makes sense.

example Workbooks.Open ("F:\Direct Payments DOT\0.5 yearly payment
planner.xls")


Are you opening the "main" workbook (the one with the code in it) from the
"pen stick" also? If so, you can use ThisWorkbook.Path to get the path to
the workbook... if that is the same directory for all files (in both the pen
stick and your work computer), then you can use that in its entirety in
place of the hard-coded path you showed in your (single) example. Or, if
everything is not in the same ultimate directory, you can "rob" the drive
letter from the front of ThisWorkbook.Path (use the Left function to do
that) and use it instead of hard-coding the letter.

--
Rick (MVP - Excel)

--
Rick (MVP - Excel)


Johnnyboy5[_2_]

open several workbooks at the same time
 
On 7 June, 15:03, "Rick Rothstein"
wrote:
just pluged in my pen stick into my works PC and it wont open the
files - coz the file drive at work is called e.g *F: * at home its
called *G:


so the workbooks dont get found unless I manually change the drive in
the code text


hope this makes sense.


example *Workbooks.Open ("F:\Direct Payments DOT\0.5 yearly payment
planner.xls")


Are you opening the "main" workbook (the one with the code in it) from the
"pen stick" also? If so, you can use ThisWorkbook.Path to get the path to
the workbook... if that is the same directory for all files (in both the pen
stick and your work computer), then you can use that in its entirety in
place of the hard-coded path you showed in your (single) example. Or, if
everything is not in the same ultimate directory, you can "rob" the drive
letter from the front of ThisWorkbook.Path (use the Left function to do
that) and use it instead of hard-coding the letter.

--
Rick (MVP - Excel)

--
Rick (MVP - Excel)


thanks Rick,

Dont quite understand "rob" anyway what I have done is to rename the
pen drive letter to "X" and changed the codes to read / look for "x"
this wont conflict with home or office. But I am still interest in
what you mean by rob, how do i use the left function instead of hard
coding the letter

best wishes

Johnny

Johnnyboy5[_2_]

open several workbooks at the same time
 
On 7 June, 15:03, "Rick Rothstein"
wrote:
just pluged in my pen stick into my works PC and it wont open the
files - coz the file drive at work is called e.g *F: * at home its
called *G:


so the workbooks dont get found unless I manually change the drive in
the code text


hope this makes sense.


example *Workbooks.Open ("F:\Direct Payments DOT\0.5 yearly payment
planner.xls")


Are you opening the "main" workbook (the one with the code in it) from the
"pen stick" also? If so, you can use ThisWorkbook.Path to get the path to
the workbook... if that is the same directory for all files (in both the pen
stick and your work computer), then you can use that in its entirety in
place of the hard-coded path you showed in your (single) example. Or, if
everything is not in the same ultimate directory, you can "rob" the drive
letter from the front of ThisWorkbook.Path (use the Left function to do
that) and use it instead of hard-coding the letter.

--
Rick (MVP - Excel)

--
Rick (MVP - Excel)


also can you show me an example of how you write the text.
mine is...
Workbooks.Open ("F:\Direct Payments DOT\0.5 yearly payment
planner.xls")


Rick Rothstein

open several workbooks at the same time
 
Maybe "rob" was to casual a word to use... what I meant was "take the
relevant part of the text and use it in your code". As an example...

DriveLetter = Left(ThisWorkbook.Path, 1)
Workbooks.Open (" & DriveLetter & _
":\Direct Payments DOT\0.5 yearly payment planner.xls")

--
Rick (MVP - Excel)



"Johnnyboy5" wrote in message
...
On 7 June, 15:03, "Rick Rothstein"
wrote:
just pluged in my pen stick into my works PC and it wont open the
files - coz the file drive at work is called e.g F: at home its
called G:


so the workbooks dont get found unless I manually change the drive in
the code text


hope this makes sense.


example Workbooks.Open ("F:\Direct Payments DOT\0.5 yearly payment
planner.xls")


Are you opening the "main" workbook (the one with the code in it) from
the
"pen stick" also? If so, you can use ThisWorkbook.Path to get the path to
the workbook... if that is the same directory for all files (in both the
pen
stick and your work computer), then you can use that in its entirety in
place of the hard-coded path you showed in your (single) example. Or, if
everything is not in the same ultimate directory, you can "rob" the drive
letter from the front of ThisWorkbook.Path (use the Left function to do
that) and use it instead of hard-coding the letter.

--
Rick (MVP - Excel)

--
Rick (MVP - Excel)


also can you show me an example of how you write the text.
mine is...
Workbooks.Open ("F:\Direct Payments DOT\0.5 yearly payment
planner.xls")



Johnnyboy5[_2_]

open several workbooks at the same time
 
On 7 June, 20:01, "Rick Rothstein"
wrote:
Maybe "rob" was to casual a word to use... what I meant was "take the
relevant part of the text and use it in your code". As an example...

DriveLetter = Left(ThisWorkbook.Path, 1)
Workbooks.Open (" & DriveLetter & _
* * *":\Direct Payments DOT\0.5 yearly payment planner.xls")

--
Rick (MVP - Excel)

"Johnnyboy5" wrote in message

...



On 7 June, 15:03, "Rick Rothstein"
wrote:
just pluged in my pen stick into my works PC and it wont open the
files - coz the file drive at work is called e.g *F: * at home its
called *G:


so the workbooks dont get found unless I manually change the drive in
the code text


hope this makes sense.


example *Workbooks.Open ("F:\Direct Payments DOT\0.5 yearly payment
planner.xls")


Are you opening the "main" workbook (the one with the code in it) from
the
"pen stick" also? If so, you can use ThisWorkbook.Path to get the path to
the workbook... if that is the same directory for all files (in both the
pen
stick and your work computer), then you can use that in its entirety in
place of the hard-coded path you showed in your (single) example. Or, if
everything is not in the same ultimate directory, you can "rob" the drive
letter from the front of ThisWorkbook.Path (use the Left function to do
that) and use it instead of hard-coding the letter.


--
Rick (MVP - Excel)


--
Rick (MVP - Excel)


also can you show me an example of how you write the text.
mine is...
Workbooks.Open ("F:\Direct Payments DOT\0.5 yearly payment
planner.xls")


OK - will give it a go and then try it in work tomorrow. thanks very
much for your help.

Johnny

Johnnyboy5[_2_]

open several workbooks at the same time
 
On 7 June, 20:22, Johnnyboy5 wrote:
On 7 June, 20:01, "Rick Rothstein"





wrote:
Maybe "rob" was to casual a word to use... what I meant was "take the
relevant part of the text and use it in your code". As an example...


DriveLetter = Left(ThisWorkbook.Path, 1)
Workbooks.Open (" & DriveLetter & _
* * *":\Direct Payments DOT\0.5 yearly payment planner.xls")


--
Rick (MVP - Excel)


"Johnnyboy5" wrote in message


...


On 7 June, 15:03, "Rick Rothstein"
wrote:
just pluged in my pen stick into my works PC and it wont open the
files - coz the file drive at work is called e.g *F: * at home its
called *G:


so the workbooks dont get found unless I manually change the drive in
the code text


hope this makes sense.


example *Workbooks.Open ("F:\Direct Payments DOT\0.5 yearly payment
planner.xls")


Are you opening the "main" workbook (the one with the code in it) from
the
"pen stick" also? If so, you can use ThisWorkbook.Path to get the path to
the workbook... if that is the same directory for all files (in both the
pen
stick and your work computer), then you can use that in its entirety in
place of the hard-coded path you showed in your (single) example. Or, if
everything is not in the same ultimate directory, you can "rob" the drive
letter from the front of ThisWorkbook.Path (use the Left function to do
that) and use it instead of hard-coding the letter.


--
Rick (MVP - Excel)


--
Rick (MVP - Excel)


also can you show me an example of how you write the text.
mine is...
Workbooks.Open ("F:\Direct Payments DOT\0.5 yearly payment
planner.xls")


OK - will give it a go and then try it in work tomorrow. *thanks very
much for your help.

Johnny- Hide quoted text -

- Show quoted text -


Nope - my works PC is locked and defaults to "f" drive so although I
set my pen drive to be "x" it still picks it up as "f" which means the
code which had "x" in is wont work so I changed the code again back to
"F". I can work out how to use

DriveLetter = Left(ThisWorkbook.Path, 1)
Workbooks.Open (" & DriveLetter & _
":\Direct Payments DOT\0.5 yearly payment planner.xls")

I know I am now pushing it but could you write the code just as you
might use it "live" and I could pick the bones out of it.

My works PC is reading the pen drive as "f" my lap top reads it as
"g" coz "f" is used for the DVD not sure what my home PC reads it as
(haven't tried it yet)

here is the actual code I need to use.

Private Sub Workbook_Open()

Workbooks.Open ("f:\Direct Payments DOT\1 payments cheryl.xls")
Workbooks.Open ("f:\Direct Payments DOT\1 payments Sandra.xls") '
Change as required
Workbooks.Open ("f:\Direct Payments DOT\1 payments Liv.xls")
Workbooks.Open ("f:\Direct Payments DOT\1 payments Sally.xls")
Workbooks.Open ("f:\Direct Payments DOT\0.5 yearly payment
planner.xls")
End Sub

THANKS VERY MUCH.

Johnnyboy

many thanks

John




All times are GMT +1. The time now is 02:24 AM.

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