Results 1 to 2 of 2

Thread: Open word userform from excel
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Mar 2019
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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
        'ActiveWorkbook.Close
        Windows.Application.Quit
    End Sub
    Thank you all !

  2. #2
    Moderator Macropod's Avatar
    Join Date
    Aug 2007
    Location
    Canberra, Australia
    Posts
    3,274
    Post Thanks / Like
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Open word userform from excel

    Cross-posted at: http://www.msofficeforums.com/word-v...orm-excel.html
    Please read Mr Excel's policy on Cross-Posting in rule 13: http://www.mrexcel.com/forum/board-a...rum-rules.html
    Cheers
    Paul Edstein
    [MS MVP - Word]

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •