Be the first user to complete this post

  • 0
Add to List

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

This tutorial will teach you how to Open a MS Word Document using Excel File using Explorer Window. We will be using Application.GetOpenFile() function to accomplish 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.

Complete 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 Document using Explorer Window
Open Word Document using Explorer Window 2
Open Word Document using Explorer Window 2



Also Read:

  1. VBA-Excel: Edit And Save an Existing Word Document
  2. Send Mail With Multiple Different Attachments From MS Outlook using Excel.
  3. VBA-Excel: Appending Text to an Existing Word Document - at the End
  4. VBA-Excel: Add/Insert a Image/Picture in Word Document
  5. VBA-Excel: Enumerate all the opened word document
  6. Excel-VBA : Insert Multiple Images from a Folder to Excel Cells
  7. VBA-Excel: Open an Existing Word Document
  8. Excel-VBA : Change Passwords for all the WorkSheets in one shot