question regarding code to open word doc from excel

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

question regarding code to open word doc from excel

Post by ABabeNChrist »

I have Windows XP with Office 2007 and I’m using this type of code to open different word documents, I was wondering if this code is also compatible with other operating systems like Vista and Windows 7. I would think they are, I just want to be sure. And as long as both the excel workbook and word docm are located within same folder it should work correct.

Code: Select all

Set wordapp = CreateObject("Word.Application")
Set worddoc = wordapp.Documents.Open(ThisWorkbook.Path & "\Report folder\report part 1.docm")
    wordapp.Visible = True

User avatar
HansV
Administrator
Posts: 78481
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: question regarding code to open word doc from excel

Post by HansV »

This code does not depend on the version of Windows, it should work in any version as long as the user has either Office 2007 (or later), or an earlier version together with the Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint 2007 file formats.
Best wishes,
Hans

ABabeNChrist
SilverLounger
Posts: 1868
Joined: 25 Jan 2010, 14:00
Location: Conroe, Texas

Re: question regarding code to open word doc from excel

Post by ABabeNChrist »

I was hoping that
Thanks HansV