hello friends,
Is it possible to open MS Word document from MS Excel using Macros ? If possible, Can someone provide me the macro code for the same ?
thank you
hello friends,
Is it possible to open MS Word document from MS Excel using Macros ? If possible, Can someone provide me the macro code for the same ?
thank you
Here's the macro code for you to open Ms Word document from Excel -
With this macro, you can open any word document on your computer. This is relatively small but very cool macro. You can attach it to a button or checkbox and then, whenever you'll click the button or checkbox, a specified Microsoft word document will be open.Code:Sub Open_Word_Document() 'Opens a Word Document from Excel Dim objWord As Object Set objWord = CreateObject("Word.Application") objWord.Visible = True 'Change the directory path and file name to the location 'of your document objWord.Documents.Open "C:\test.doc" End Sub
You can also change the word document that you want to open just by changing a single line(second-last line) of this macro code -
objWord.Documents.Open "C:\test.doc"
so that the directory and file name including extension, point to the desired file on your computer.
Another way of opening Word document from Excel without using code, would be to attach a hyperlink to the command button that points to the Word document. This will automatically start Word and open the target file.
Bookmarks