Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Vba - opening doc from Excel Vba

Hi all,

Does anybody knows how to open Template.dot from excel Vba?

I asume it's something like:

ChangeFileOpenDirectory Route

Documents.Open Filename:="Template.dot"

I think the problem is with References. I tried activating "Microsof
Word 11 Object Library" but still doesn't works.

Thanks,
Aldo

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Vba - opening doc from Excel Vba


As well as adding in the reference to the Word object
library, you need to create an instance of Word and make
it visible. Then you can use this Word to open the
template.

Use code similar to this:

' Declare a variable and set it to an instance of Word
Dim Word As New Word.Application

' Make the application visible
Word.Visible = True
' Open the document
Word.Documents.Open "C:\Templates\template.dot"

I've called my variable Word, but it can be anything you
like.

HTH
Helen

-----Original Message-----
Hi all,

Does anybody knows how to open Template.dot from excel

Vba?

I asume it's something like:

ChangeFileOpenDirectory Route

Documents.Open Filename:="Template.dot"

I think the problem is with References. I tried

activating "Microsoft
Word 11 Object Library" but still doesn't works.

Thanks,
Aldo.


---
Message posted from http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default Vba - opening doc from Excel Vba

You want to EDIT a Word template in Excel?


--

John
johnf202 at hotmail dot com
"ajliaks " wrote in message ...
Hi all,

Does anybody knows how to open Template.dot from excel Vba?

I asume it's something like:

ChangeFileOpenDirectory Route

Documents.Open Filename:="Template.dot"

I think the problem is with References. I tried activating "Microsoft
Word 11 Object Library" but still doesn't works.

Thanks,
Aldo.


---
Message posted from http://www.ExcelForum.com/

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I stop blank workbook from opening when opening an existing kjg Excel Discussion (Misc queries) 3 February 12th 10 09:36 PM
Trouble opening large size Excel file 155Mb in Excel 2007 pl2c Excel Discussion (Misc queries) 2 July 14th 06 11:45 PM
REF errors when opening excel in xp. works fine when opening wor. br Excel Discussion (Misc queries) 6 September 13th 05 11:41 AM
excel VBA problem - setting workbook as variable & opening/re-opening safe Excel Programming 1 August 20th 04 12:22 AM
Excel recalculates formulas when opening files last saved by an earlier version of Excel Jim Rech Excel Programming 0 April 7th 04 06:47 PM


All times are GMT +1. The time now is 03:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"