LoginSignup
0
0

More than 3 years have passed since last update.

テスト3

Posted at
'ブックB
Sub Sample()
Dim p As String
Dim wb As Object

p = "C:\Users\user\Desktop\A.xlsm"
Set wb = Workbooks.Open(p)

wb.VBProject.VBComponents("UserForm1").Designer.Controls("textbox1").Value = "テスト"
MsgBox wb.VBProject.VBComponents("UserForm1").Designer.Controls("CommandButton1").Caption

Application.Run "A.xlsm!フォームを開く"
Application.Run "A.xlsm!コマンドボタンクリック"
End Sub

'-----------------------------------------------------------
'ブックA
Sub コマンドボタンクリック()
Call UserFormA.CommandButton1_Click
End Sub

Sub CommandButton1_Click()
MsgBox "メッセージ"
End Sub

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0