Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Contact us
Hide Buttons

Excel-VBA : Open a MS Word Document using Excel File using Explorer Window.

This tuto­r­ial will teach you how to Open a MS Word Doc­u­ment using Excel File using Explorer Win­dow. We will be using Application.GetOpenFile() func­tion to accom­plish this.

NOTE: You can define any type file you want to , just set the proper filter.

FileFilter:=“Word Files *.doc* (*.doc*) — to open Excel files.

Com­plete Code:

Sub browse()
    Dim FSO As Object
    Dim blnOpen
    strFileToOpen = Application.GetOpenFilename(Title:="Please choose a file to open", _
    FileFilter:="Word Files *.doc* (*.doc*),")
    If strFileToOpen = False Then
      MsgBox "No file selected.", vbExclamation, "Sorry!"
      Exit Sub
    Else
        Sheet2.Range("G5").Value = strFileToOpen
        Set objWord = CreateObject("Word.Application")
        Set objDoc = objWord.Documents.Open(strFileToOpen)
        objWord.Visible = True
    End If
End Sub

Open Word Document using Explorer Window

Open Word Doc­u­ment using Explorer Window

Open Word Document using Explorer Window 2

Open Word Doc­u­ment using Explorer Win­dow 2

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: