I need to be able to have another workbook open at the same time I open one.
So if I open workbook A , Workbook B will open automatically.
What is the best way to do that
use this code in the quot;This workbookquot; section in the workbook VBA.Private Sub Workbook_Open()
Workbooks.Open Filename:= _
quot;C:\Documents and Settings\user\My Documents\Book14.xlsquot;
End Sub
change the file name section to the location of the file you wish to
open and voila.--
blounty
------------------------------------------------------------------------
blounty's Profile: www.excelforum.com/member.php...oamp;userid=32632
View this thread: www.excelforum.com/showthread...hreadid=524437thank you for your help
quot;blountyquot; wrote:
gt;
gt; use this code in the quot;This workbookquot; section in the workbook VBA.
gt;
gt;
gt; Private Sub Workbook_Open()
gt; Workbooks.Open Filename:= _
gt; quot;C:\Documents and Settings\user\My Documents\Book14.xlsquot;
gt; End Sub
gt;
gt; change the file name section to the location of the file you wish to
gt; open and voila.
gt;
gt;
gt; --
gt; blounty
gt; ------------------------------------------------------------------------
gt; blounty's Profile: www.excelforum.com/member.php...oamp;userid=32632
gt; View this thread: www.excelforum.com/showthread...hreadid=524437
gt;
gt;
Well I thought it worked, here is the code I have in the this workbook VBA,
but I get an error message saying quot; compile error: ambiguos name detected:
workbook_openquot;
Is there a way to fix that?
quot;blountyquot; wrote:
gt;
gt; use this code in the quot;This workbookquot; section in the workbook VBA.
gt;
gt;
gt; Private Sub Workbook_Open()
gt; Workbooks.Open Filename:= _
gt; quot;C:\Documents and Settings\user\My Documents\Book14.xlsquot;
gt; End Sub
gt;
gt; change the file name section to the location of the file you wish to
gt; open and voila.
gt;
gt;
gt; --
gt; blounty
gt; ------------------------------------------------------------------------
gt; blounty's Profile: www.excelforum.com/member.php...oamp;userid=32632
gt; View this thread: www.excelforum.com/showthread...hreadid=524437
gt;
gt;
You only get one workbook_open event.
You'll have to merge the code from blounty into your existing workbook_open
procedure.
JackR wrote:
gt;
gt; Well I thought it worked, here is the code I have in the this workbook VBA,
gt; but I get an error message saying quot; compile error: ambiguos name detected:
gt; workbook_openquot;
gt;
gt; Is there a way to fix that?
gt;
gt; quot;blountyquot; wrote:
gt;
gt; gt;
gt; gt; use this code in the quot;This workbookquot; section in the workbook VBA.
gt; gt;
gt; gt;
gt; gt; Private Sub Workbook_Open()
gt; gt; Workbooks.Open Filename:= _
gt; gt; quot;C:\Documents and Settings\user\My Documents\Book14.xlsquot;
gt; gt; End Sub
gt; gt;
gt; gt; change the file name section to the location of the file you wish to
gt; gt; open and voila.
gt; gt;
gt; gt;
gt; gt; --
gt; gt; blounty
gt; gt; ------------------------------------------------------------------------
gt; gt; blounty's Profile: www.excelforum.com/member.php...oamp;userid=32632
gt; gt; View this thread: www.excelforum.com/showthread...hreadid=524437
gt; gt;
gt; gt;
--
Dave Peterson
How would the formula go so that both events can take place?
I am still learning.
Thanks
quot;Dave Petersonquot; wrote:
gt; You only get one workbook_open event.
gt;
gt; You'll have to merge the code from blounty into your existing workbook_open
gt; procedure.
gt;
gt; JackR wrote:
gt; gt;
gt; gt; Well I thought it worked, here is the code I have in the this workbook VBA,
gt; gt; but I get an error message saying quot; compile error: ambiguos name detected:
gt; gt; workbook_openquot;
gt; gt;
gt; gt; Is there a way to fix that?
gt; gt;
gt; gt; quot;blountyquot; wrote:
gt; gt;
gt; gt; gt;
gt; gt; gt; use this code in the quot;This workbookquot; section in the workbook VBA.
gt; gt; gt;
gt; gt; gt;
gt; gt; gt; Private Sub Workbook_Open()
gt; gt; gt; Workbooks.Open Filename:= _
gt; gt; gt; quot;C:\Documents and Settings\user\My Documents\Book14.xlsquot;
gt; gt; gt; End Sub
gt; gt; gt;
gt; gt; gt; change the file name section to the location of the file you wish to
gt; gt; gt; open and voila.
gt; gt; gt;
gt; gt; gt;
gt; gt; gt; --
gt; gt; gt; blounty
gt; gt; gt; ------------------------------------------------------------------------
gt; gt; gt; blounty's Profile: www.excelforum.com/member.php...oamp;userid=32632
gt; gt; gt; View this thread: www.excelforum.com/showthread...hreadid=524437
gt; gt; gt;
gt; gt; gt;
gt;
gt; --
gt;
gt; Dave Peterson
gt;
Private Sub Workbook_Open()
'your existing code
'bounty's code here
Workbooks.Open Filename:= _
quot;C:\Documents and Settings\user\My Documents\Book14.xlsquot;
end sub
JackR wrote:
gt;
gt; How would the formula go so that both events can take place?
gt; I am still learning.
gt;
gt; Thanks
gt;
gt; quot;Dave Petersonquot; wrote:
gt;
gt; gt; You only get one workbook_open event.
gt; gt;
gt; gt; You'll have to merge the code from blounty into your existing workbook_open
gt; gt; procedure.
gt; gt;
gt; gt; JackR wrote:
gt; gt; gt;
gt; gt; gt; Well I thought it worked, here is the code I have in the this workbook VBA,
gt; gt; gt; but I get an error message saying quot; compile error: ambiguos name detected:
gt; gt; gt; workbook_openquot;
gt; gt; gt;
gt; gt; gt; Is there a way to fix that?
gt; gt; gt;
gt; gt; gt; quot;blountyquot; wrote:
gt; gt; gt;
gt; gt; gt; gt;
gt; gt; gt; gt; use this code in the quot;This workbookquot; section in the workbook VBA.
gt; gt; gt; gt;
gt; gt; gt; gt;
gt; gt; gt; gt; Private Sub Workbook_Open()
gt; gt; gt; gt; Workbooks.Open Filename:= _
gt; gt; gt; gt; quot;C:\Documents and Settings\user\My Documents\Book14.xlsquot;
gt; gt; gt; gt; End Sub
gt; gt; gt; gt;
gt; gt; gt; gt; change the file name section to the location of the file you wish to
gt; gt; gt; gt; open and voila.
gt; gt; gt; gt;
gt; gt; gt; gt;
gt; gt; gt; gt; --
gt; gt; gt; gt; blounty
gt; gt; gt; gt; ------------------------------------------------------------------------
gt; gt; gt; gt; blounty's Profile: www.excelforum.com/member.php...oamp;userid=32632
gt; gt; gt; gt; View this thread: www.excelforum.com/showthread...hreadid=524437
gt; gt; gt; gt;
gt; gt; gt; gt;
gt; gt;
gt; gt; --
gt; gt;
gt; gt; Dave Peterson
gt; gt;
--
Dave Peterson
- Jun 04 Wed 2008 20:44
A way to Open 2nd Workbook automatically
close
全站熱搜
留言列表
發表留言