Opening an Excel template from within Word VBA 
Author Message
 Opening an Excel template from within Word VBA

    I have some automation to MS Word 2000 for creating faxes, etc from
templates.  I now need be able to open an Excel template from with the Word
VBA program but have been unsuccessful.  I added the Excel 9.0 reference to
the Word VBA project and am trying to use the following line of code to open
the spreadsheet...

        Excel.Workbooks.Open (strPath & "\SomeSpreadsheet.xlt")

This line runs without generating any errors however I never see the Excel
template.

    Also, I want to open the template as a new spreadsheet rather than
opening the original .XLT file for editing.  I've done this with word
templates using the following code but I'm unsure how to perform the same
operation on an Excel template instead...

        Documents.Add Template:=strPath & "\SomeWordTemplate.DOT",
newtemplate:=False, DocumentType:=0

Any info would be greatly appreciated.
Rick



Wed, 23 Jun 2004 05:45:32 GMT  
 Opening an Excel template from within Word VBA
Answered in microsoft.public.word.vba beginners

Hope this helps,
regards,
Astrid

So that all can benefit from the discussion, please post all follow-ups to
the newsgroup.
Visit the MVP Word FAQ site at http://www.mvps.org/word/



Quote:
>     I have some automation to MS Word 2000 for creating faxes, etc from
> templates.  I now need be able to open an Excel template from with the
Word
> VBA program but have been unsuccessful.  I added the Excel 9.0 reference
to
> the Word VBA project and am trying to use the following line of code to
open
> the spreadsheet...

>         Excel.Workbooks.Open (strPath & "\SomeSpreadsheet.xlt")

> This line runs without generating any errors however I never see the Excel
> template.

>     Also, I want to open the template as a new spreadsheet rather than
> opening the original .XLT file for editing.  I've done this with word
> templates using the following code but I'm unsure how to perform the same
> operation on an Excel template instead...

>         Documents.Add Template:=strPath & "\SomeWordTemplate.DOT",
> newtemplate:=False, DocumentType:=0

> Any info would be greatly appreciated.
> Rick



Wed, 23 Jun 2004 08:02:31 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Opening an Excel template from within Word VBA

2. Opening Excel Template from within Access

3. Open a Excel template from word

4. vba code missing after opening a word template as doc

5. Open excel spreadsheet from within Access using VBA

6. Invoking Excel VBA from within Word

7. Opening Excel from within Word

8. Word Templates with VBA code running very slow in Word XP

9. Pasting Range from Excel 2002 via VBA to Word causes a New Workbook to open

10. Open a Word file from Excel (VBA)

11. To open a Word document from Excel VBA

12. Opening Word using Excel VBA

 

 
Powered by phpBB® Forum Software