View Single Post
 
Old 03-09-2019, 11:03 PM
matapagi2019 matapagi2019 is offline Windows XP Office 2007
Novice
 
Join Date: Mar 2019
Posts: 12
matapagi2019 is on a distinguished road
Default Open word userform from excel

I want the button on userformTombol in document "Agendaku.docm" activate after The Excel application Quit.
What is the mistakes in the following code: ? (error message : Object dosn't support this property or method)
Code:
Private Sub CommandButton1_Click()Dim ObjWord As Object
Dim ObjDoc As Object
Dim ObjForm As Object
    Set ObjWord = GetObject(, "Word.Application")
    Set ObjDoc = ObjWord.Documents("D:\Agendaku.docm")
    ObjWord.Visible = True
    Set ObjForm = ObjWord.ObjDoc.UserFormTombol
        ObjForm.CommandButton1.Enabled = True
        ObjForm.CommandButton3.Enabled = False
    ActiveWorkbook.Save
    Windows.Application.Quit
End Sub
Thank you all !
Reply With Quote