ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

Book1©I¥lBook2ªº¥¨¶°¤§«á¡ABook1¥¨¶°¤£¯àÄ~Äò

Book1©I¥lBook2ªº¥¨¶°¤§«á¡ABook1¥¨¶°¤£¯àÄ~Äò

¦pÃD¡A½Ð«ü±Ð¡IÁÂÁ¡I
¨S¥[¤J¥H¤UÂŦâµ{¦¡½X«e
Output(¥¿±`):
AAA
BBB
CCC

¦ý¥[¤J¥H¤UÂŦâµ{¦¡½X«á
Output:
AAA
BBB


[D:\temp\Test\Book1.xlsm]
Sub Macro1()
MsgBox ("AAA")
Application.Run "'D:\temp\Test\Book2.xlsm'!Macro1"
MsgBox ("CCC")
End Sub

[D:\temp\Test\Book2.xlsm]
Sub Macro1()
MsgBox ("BBB")
ThisWorkbook.Close False '¥[¤J³o«ü¥O«á¡A¤£¯àÄ~Äò Book1.xlsm!Macro1 ¾l¤Uµ{§Ç(¬õ¦r³¡¥÷)
End Sub

        ÀR«ä¦Û¦b : ¡i¦æµ½­n¤Î®É¡j¦æµ½­n¤Î®É¡A¥\¼w­n«ùÄò¡C¦p¿N¶}¤ô¤@¯ë¡A¥¼¿N¶}¤§«e¤d¸U¤£­n°±º¶¤õ­Ô¡A§_«h­«¨Ó´N¤Ó¶O¨Æ¤F¡C
ªð¦^¦Cªí ¤W¤@¥DÃD