Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Using Excel to start a merge session in Word

I want to start the merge function in Word form Excel
In Excel VBA, I use the following statements

Public Sub CommandButton1_Click()
Dim wd As Object
Dim pad, naam As String
pad = Worksheets("Basisgegevens").Range("N7").Value
naam = "boekhouding lvpc.xls"
'start Microsoft Word sessie
Set wd = CreateObject("word.application")
'Maak document zichtbaar
wd.Visible = True
'Activeer MS Word
AppActivate wd.Name
With wd
'Open geselecteerd document in Microsoft Word
.Documents.Open (pad & "\" & ListBox1.Value)
.Application.Run MacroName:="start"
End With
Set wd = Nothing
Unload Me
End Sub

I start the Word macro "start" that is going to merge ( .Application.Run
MacroName:="start") That goes wrong because the Excel session is also active
(OLE object error) and that's where the merge data is for Word (I think
that's the problem)
I'm looking for the statements in Excel VBA to merge in Word.
Who knows the solution?? (excuse me for my poor english)
Lex


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
merge two excel files like in word mail merge azmerritt Excel Discussion (Misc queries) 1 December 11th 16 09:23 PM
start Word and Mail Merge the data from excel,system will restart tmssupport Excel Discussion (Misc queries) 2 December 18th 07 03:15 PM
Trying to merge from excel to word. New names won't merge ruth tozer Excel Worksheet Functions 0 June 27th 07 05:58 AM
Startup and template locations in Citrix TS session and local session John Nurick Setting up and Configuration of Excel 2 September 21st 06 10:42 PM
Start a new session when a session is already opend MD Excel Programming 1 December 17th 05 05:47 PM


All times are GMT +1. The time now is 05:24 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"