Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Auto-Open other file
Upon opening my main excel file, I would like another file in the same folder to be opened. Is this possible? -- aposatsk ------------------------------------------------------------------------ aposatsk's Profile: http://www.excelforum.com/member.php...o&userid=36709 View this thread: http://www.excelforum.com/showthread...hreadid=567601 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Auto-Open other file
One way is to use a macro:
Option Explicit Sub auto_open() Dim WkbkName As String Dim TestStr As String WkbkName = "book2.xls" TestStr = "" On Error Resume Next TestStr = Dir(ThisWorkbook.Path & "\" & WkbkName) On Error GoTo 0 If TestStr = "" Then MsgBox "design error! " & WkbkName & " wasn't found." Else Workbooks.Open Filename:=ThisWorkbook.Path & "\" & WkbkName End If End Sub If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm aposatsk wrote: Upon opening my main excel file, I would like another file in the same folder to be opened. Is this possible? -- aposatsk ------------------------------------------------------------------------ aposatsk's Profile: http://www.excelforum.com/member.php...o&userid=36709 View this thread: http://www.excelforum.com/showthread...hreadid=567601 -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Auto-Open other file
Another way is to save the files as a Workspace.
With both books open, FileSave Workspace. A resume.xlw file will be created. You can name it whatever you wish as long as you retain the XLW format. Open that and both books will open. Gord Dibben MS Excel MVP On Wed, 2 Aug 2006 15:35:52 -0400, aposatsk wrote: Upon opening my main excel file, I would like another file in the same folder to be opened. Is this possible? |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Auto-Open other file
Gord Dibben Wrote: Another way is to save the files as a Workspace. With both books open, FileSave Workspace. A resume.xlw file will be created. You can name it whatever you wish as long as you retain the XLW format. Open that and both books will open. Gord Dibben MS Excel MVP On Wed, 2 Aug 2006 15:35:52 -0400, aposatsk wrote: Upon opening my main excel file, I would like another file in the same folder to be opened. Is this possible? If i use this method, the files which open afterwards are the same files, except all "Splits" and "Frozen Panes" are gone, and some of the sheets are zoomed to different levels than in the original. Is there any way to fix this and retain the same format? Also, if i edit File 1 and File 2 and save each afterwards, will my Workspace file take into account these changes? or do i have to re-save the workspace? -- aposatsk ------------------------------------------------------------------------ aposatsk's Profile: http://www.excelforum.com/member.php...o&userid=36709 View this thread: http://www.excelforum.com/showthread...hreadid=567601 |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Auto-Open other file
First problem..................have not been able to find a way to retain the
Splits and Frozen Panes. Second problem.............yes, the workbooks are saved with changes if saved individually or saved as workspace. Gord On Thu, 3 Aug 2006 07:55:29 -0400, aposatsk wrote: If i use this method, the files which open afterwards are the same files, except all "Splits" and "Frozen Panes" are gone, and some of the sheets are zoomed to different levels than in the original. Is there any way to fix this and retain the same format? Also, if i edit File 1 and File 2 and save each afterwards, will my Workspace file take into account these changes? or do i have to re-save the workspace? |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
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! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code to Open Excel File Please Help | Excel Discussion (Misc queries) | |||
Excel Outlook Attachments opening after several errors everytime | Setting up and Configuration of Excel | |||
Links picking up values from an older version of linked file | Links and Linking in Excel | |||
Can Only open files using file ~ open | Excel Discussion (Misc queries) | |||
hidden rows & columns slow file open | Excel Discussion (Misc queries) |