Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All, I want to populate a word template with data frome excel. I have
designed an "Export" button in excel sheet, which on clicking should populate certain fields in a word file. Here is my code so far, But its not working!! Any help would be highly appretiated. Private Sub Export_Click() Dim objWord As New Word.Application Dim doc As Word.Document Dim bkmk As Word.Bookmark sWdFileName = Application.GetOpenFilename(, , , , False) Set doc = objWord.Documents.Open(sWdFileName) strTemplateName = "TestTemplate.dot" strPathTemplateName = "C:\My Documents" & strTemplateName Set objWord = CreateObject("Word.Application") With objWord .ActiveDocument.variables("Address").Value = Range("Address").Value End With objWord.Visible = True Set objDoc = Nothing Set objWord = Nothing End Sub Thanks in Advance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
I need my export to include the "file as" category in Excel | Excel Discussion (Misc queries) | |||
Export to excel via webpage: "Invalid Procedure Call or Argument" | Excel Programming | |||
How do export Excel file to .txt delimited by "^"? | Excel Discussion (Misc queries) | |||
Folder Graphic (in Word & Pub) instead of "Close" button in Excel | Excel Discussion (Misc queries) |