Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
merge two excel files like in word mail merge | Excel Discussion (Misc queries) | |||
start Word and Mail Merge the data from excel,system will restart | Excel Discussion (Misc queries) | |||
Trying to merge from excel to word. New names won't merge | Excel Worksheet Functions | |||
Startup and template locations in Citrix TS session and local session | Setting up and Configuration of Excel | |||
Start a new session when a session is already opend | Excel Programming |