ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   i want to open a second workbook automatically when i open the fir (https://www.excelbanter.com/excel-discussion-misc-queries/249568-i-want-open-second-workbook-automatically-when-i-open-fir.html)

[email protected] uk

i want to open a second workbook automatically when i open the fir
 
both work books are in C:\
the master workbook name is test
the slave workbook name is data

Jacob Skaria

i want to open a second workbook automatically when i open the fir
 
--You can open multiple workbooks and save as workspace .xlw. Opening this
workspace would open all linked workbooks.

--VBA method...Set the security level to low/medium in
(Tools|Macro|Security). Open master workbook. Press Alt+F11 to launch VBE
(Visual Basic Editor). From the left treeview search for the workbook name
and click on + to expand it. Within that you should see the following

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
This Workbook

Double click 'This WorkBook' and paste the below code to the right code pane.
Private Sub Workbook_Open()
Workbooks.Open Me.Path & "\data.xls"
End Sub

SaveClose and re-open master file..which should open the data.xls from the
same folder

If this post helps click Yes
---------------
Jacob Skaria


uk" wrote:

both work books are in C:\
the master workbook name is test
the slave workbook name is data


Gary''s Student

i want to open a second workbook automatically when i open the fir
 
Include the following event macro in the workbook code area of the test
workbook:

Private Sub Workbook_Open()
Workbooks.Open ("C:\data.xls")
End Sub

Because it is workbook code, it is very easy to install and use:

1. right-click the tiny Excel icon just to the left of File on the Menu Bar
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (workbook code), see:

http://www.mvps.org/dmcritchie/excel/event.htm

--
Gary''s Student - gsnu200909


uk" wrote:

both work books are in C:\
the master workbook name is test
the slave workbook name is data


[email protected] uk

i want to open a second workbook automatically when i open the
 
'run-time error 1004' comes up

"Jacob Skaria" wrote:

--You can open multiple workbooks and save as workspace .xlw. Opening this
workspace would open all linked workbooks.

--VBA method...Set the security level to low/medium in
(Tools|Macro|Security). Open master workbook. Press Alt+F11 to launch VBE
(Visual Basic Editor). From the left treeview search for the workbook name
and click on + to expand it. Within that you should see the following

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
This Workbook

Double click 'This WorkBook' and paste the below code to the right code pane.
Private Sub Workbook_Open()
Workbooks.Open Me.Path & "\data.xls"
End Sub

SaveClose and re-open master file..which should open the data.xls from the
same folder

If this post helps click Yes
---------------
Jacob Skaria


uk" wrote:

both work books are in C:\
the master workbook name is test
the slave workbook name is data


[email protected] uk

i want to open a second workbook automatically when i open the
 
'run-time error 1004' comes up

"Gary''s Student" wrote:

Include the following event macro in the workbook code area of the test
workbook:

Private Sub Workbook_Open()
Workbooks.Open ("C:\data.xls")
End Sub

Because it is workbook code, it is very easy to install and use:

1. right-click the tiny Excel icon just to the left of File on the Menu Bar
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (workbook code), see:

http://www.mvps.org/dmcritchie/excel/event.htm

--
Gary''s Student - gsnu200909


uk" wrote:

both work books are in C:\
the master workbook name is test
the slave workbook name is data


Dave Peterson

i want to open a second workbook automatically when i open the fir
 
You didn't post a response to the last suggestion at your other post.

uk wrote:

both work books are in C:\
the master workbook name is test
the slave workbook name is data


--

Dave Peterson

[email protected] uk

i want to open a second workbook automatically when i open the
 
'run-time error 1004' comes up


"Dave Peterson" wrote:

You didn't post a response to the last suggestion at your other post.

uk wrote:

both work books are in C:\
the master workbook name is test
the slave workbook name is data


--

Dave Peterson
.


Dave Peterson

i want to open a second workbook automatically when i open the
 
That wasn't the last response.

uk wrote:

'run-time error 1004' comes up

"Dave Peterson" wrote:

You didn't post a response to the last suggestion at your other post.

uk wrote:

both work books are in C:\
the master workbook name is test
the slave workbook name is data


--

Dave Peterson
.


--

Dave Peterson

[email protected] uk

i want to open a second workbook automatically when i open the
 
this code worked before but now it dosn't i found it in a previous timesheet
vba

Private Sub Workbook_Open()
Workbooks.Open Filename:="D:\lorne stewart\timesheet\2008\data.xls"
End Sub


"Dave Peterson" wrote:

That wasn't the last response.

uk wrote:

'run-time error 1004' comes up

"Dave Peterson" wrote:

You didn't post a response to the last suggestion at your other post.

uk wrote:

both work books are in C:\
the master workbook name is test
the slave workbook name is data

--

Dave Peterson
.


--

Dave Peterson
.


Dave Peterson

i want to open a second workbook automatically when i open the
 
Did you try recording a new macro when you do it manually?

uk wrote:

this code worked before but now it dosn't i found it in a previous timesheet
vba

Private Sub Workbook_Open()
Workbooks.Open Filename:="D:\lorne stewart\timesheet\2008\data.xls"
End Sub

"Dave Peterson" wrote:

That wasn't the last response.

uk wrote:

'run-time error 1004' comes up

"Dave Peterson" wrote:

You didn't post a response to the last suggestion at your other post.

uk wrote:

both work books are in C:\
the master workbook name is test
the slave workbook name is data

--

Dave Peterson
.


--

Dave Peterson
.


--

Dave Peterson

[email protected] uk

i want to open a second workbook automatically when i open the
 
how do i record a new macro msoffice excel 2007


"Dave Peterson" wrote:

Did you try recording a new macro when you do it manually?

uk wrote:

this code worked before but now it dosn't i found it in a previous timesheet
vba

Private Sub Workbook_Open()
Workbooks.Open Filename:="D:\lorne stewart\timesheet\2008\data.xls"
End Sub

"Dave Peterson" wrote:

That wasn't the last response.

uk wrote:

'run-time error 1004' comes up

"Dave Peterson" wrote:

You didn't post a response to the last suggestion at your other post.

uk wrote:

both work books are in C:\
the master workbook name is test
the slave workbook name is data

--

Dave Peterson
.


--

Dave Peterson
.


--

Dave Peterson
.


Gord Dibben

i want to open a second workbook automatically when i open the
 
Help...........record a macro

Note the part about adding the Developer Tab to the Ribbon.


Gord Dibben MS Excel MVP


On Mon, 30 Nov 2009 15:08:02 -0800, uk
wrote:

how do i record a new macro msoffice excel 2007


"Dave Peterson" wrote:

Did you try recording a new macro when you do it manually?

uk wrote:

this code worked before but now it dosn't i found it in a previous timesheet
vba

Private Sub Workbook_Open()
Workbooks.Open Filename:="D:\lorne stewart\timesheet\2008\data.xls"
End Sub

"Dave Peterson" wrote:

That wasn't the last response.

uk wrote:

'run-time error 1004' comes up

"Dave Peterson" wrote:

You didn't post a response to the last suggestion at your other post.

uk wrote:

both work books are in C:\
the master workbook name is test
the slave workbook name is data

--

Dave Peterson
.


--

Dave Peterson
.


--

Dave Peterson
.



[email protected] uk

i want to open a second workbook automatically when i open the
 
i am giving up on this project as i can't seem to get the answer that i need
to get it to work

"Gord Dibben " wrote:

Help...........record a macro

Note the part about adding the Developer Tab to the Ribbon.


Gord Dibben MS Excel MVP


On Mon, 30 Nov 2009 15:08:02 -0800, uk
wrote:

how do i record a new macro msoffice excel 2007


"Dave Peterson" wrote:

Did you try recording a new macro when you do it manually?

uk wrote:

this code worked before but now it dosn't i found it in a previous timesheet
vba

Private Sub Workbook_Open()
Workbooks.Open Filename:="D:\lorne stewart\timesheet\2008\data.xls"
End Sub

"Dave Peterson" wrote:

That wasn't the last response.

uk wrote:

'run-time error 1004' comes up

"Dave Peterson" wrote:

You didn't post a response to the last suggestion at your other post.

uk wrote:

both work books are in C:\
the master workbook name is test
the slave workbook name is data

--

Dave Peterson
.


--

Dave Peterson
.


--

Dave Peterson
.


.



All times are GMT +1. The time now is 03:53 PM.

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