|
Be the first user to complete this post
|
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


Also Read:
- VBA-Excel: Login To Already Opened GMAIL In An Internet Explorer (IE)
- VBA-Excel: Change Font, Color, Weight of Table Data in the Word document
- VBA-Excel — AttachmentFetcher — Download all the Attachments from All the Mails of Specific Subject in Microsoft Outlook .
- VBA-Excel: Create and Save the Word document
- VBA-Excel: Appending Text to Existing Word Document - at Beginning