Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm attempting to open a 2nd workbook from a command button on the
1st. The 2nd file, in turn, is to open a companion file (File3.xls). Problem is that "File2" won't open "File3". To test to see if this code segment was even being executed on startup I placed a MsgBox in it. The MsgBox always comes up. However, if I open "File2" directly from Excel everything works OK. To summarize the results in each case, the sequence is: Case A: 1) From with Excel, Open File1; 2) Click CommandButton1, which opens "File2"; 3) MsgBox comes up, but File3 never opens. Case B: 1) From within Excel, Open File2; 2) MsgBox comes up AND File3 opens. What gives? CODE IN FIRST FILE: Private Sub CommandButton1_Click() Workbooks.Open FileName:="C:File2.xls", updatelinks:=True End Sub CODE IN 2ND FILE (ThisWorkbook): Private Sub Workbook_Open() Workbooks.Open FileName:="C:File3.xls" ' I also tried the following command: ' Application.Workbooks.Open "C:\File3.xls" prompt = "This works" dummy = MsgBox(prompt, vbOKOnly, "Test") End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2 excel workbooks open up from 1 file; named :1 and :2 - why? | Excel Discussion (Misc queries) | |||
when i open an Excell file 3 workbooks open.Why? | Excel Discussion (Misc queries) | |||
duplicate workbooks open while working in that file | Excel Discussion (Misc queries) | |||
When I open Excel, workbooks open automatically. How can I stop t | Excel Discussion (Misc queries) | |||
Workbooks.Open / .Open Text - How do you stop the .xls addition? | Excel Programming |