Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 64
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 64
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 64
Default 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



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 64
Default 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
.

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 64
Default 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
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
is it possible to open a second workbook automatically [email protected] uk Excel Discussion (Misc queries) 1 November 24th 09 06:31 PM
A way to Open 2nd Workbook automatically JackR Excel Discussion (Misc queries) 6 March 20th 06 08:15 PM
Run a macro automatically on workbook open tweacle Excel Worksheet Functions 2 February 25th 06 06:38 PM
open workbook automatically Jo Coen Excel Discussion (Misc queries) 2 July 29th 05 11:57 AM
Automatically execute a CTRL-ALT-F9 when I open a workbook Antonio Duarte Excel Discussion (Misc queries) 1 June 15th 05 02:48 PM


All times are GMT +1. The time now is 01:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"