LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Problems starting Word from Excel VBA

I have this code (as part of a long automation code, that simulates mailmerge by substituting bookmarks in a Word template with information from a spreadsheet):

On Error Resume Next
Set Wdapp = GetObject(, "Word.application")
If Err.Number < 0 Then
Set Wdapp = CreateObject("Word.Application")
End If

It was made for Excel 2003, and now - after having upgraded to 2007 it does not work. If an instance of Word is already open, when I run the code, it Works as it is supposed, but if Word is not already started, it doesn't. So apparently the
Set Wdapp = CreateObject("Word.Application") par does not execute.

I have references to

Visual Basic for Applications
Microsoft Excel 12.0 Object Library
OLE Automation
Microsoft Office 12.0 Object Library
Microsoft Word 12.0 Object Library
Microsoft Office 12 Authorization Control 1.0 Type Library
Microsoft ActiveX Data Objects 2.8 Library
Microsoft ActiveX Data Objects Recordset 6.0 Library

What am I missing here?

Jan
 
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
starting Word with an Excel macro Russ Excel Programming 2 December 6th 09 09:07 PM
starting Word from an Excel macro Russ Excel Programming 3 November 23rd 09 06:18 PM
keyboard is locked after starting in both word and excel kfaul Excel Discussion (Misc queries) 0 November 18th 08 03:48 PM
Starting Word from Excel AndyC812 Excel Programming 2 June 14th 08 05:57 PM
Starting Excel from Word MichaelS_[_6_] Excel Programming 4 March 3rd 06 03:50 PM


All times are GMT +1. The time now is 11:46 PM.

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"