LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Auto-Open other file

"aposatsk" wrote:

Upon opening my main excel file, I would like another file in the same
folder to be opened. Is this possible?


You can try this by saving the files in a workspace, but then your viewing
settings (show gridlines, row/col headers, etc.) are all replaced by defaults.

The way that worked best for me was to enter code similar to the following
in the "ThisWorkbook" module of my primary workbook in Visual Basic:

Private Sub Workbook_Open()

Dim MyPath As String
MyPath = ThisWorkbook.Path

Workbooks.Open (MyPath & "\workbook4.xls") 'Alternatively, you could
specify the full path
Workbooks.Open (MyPath & "\workbook3.xls")
Workbooks.Open (MyPath & "\workbook2.xls")

Workbooks(1).Activate 'Places
primary workbook on top

Application.ShowWindowsInTaskbar = False 'These two lines might not
be needed on
Application.ShowWindowsInTaskbar = True 'your system

End Sub

Now, whenever my primary workbook is opened, the other workbooks open
automatically, looking just as they were when I last saved them. This
example requires all the workbooks involved to be in the same directory as
the primary one, but you could always specify full paths.

On my system, something weird happens with the taskbar if I omit the last
two lines of the procedure; you may or may not need them on your system.

Good luck!
 
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
Code to Open Excel File Please Help Cole Excel Discussion (Misc queries) 2 July 10th 06 09:04 PM
Excel Outlook Attachments opening after several errors everytime cito_support Setting up and Configuration of Excel 2 March 13th 06 06:15 PM
Links picking up values from an older version of linked file Cate Links and Linking in Excel 4 October 20th 05 01:53 PM
Can Only open files using file ~ open tek4u Excel Discussion (Misc queries) 4 July 11th 05 05:31 PM
hidden rows & columns slow file open Simon Shaw Excel Discussion (Misc queries) 0 April 5th 05 12:21 AM


All times are GMT +1. The time now is 05:25 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"