![]() |
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 |
All times are GMT +1. The time now is 10:46 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com