Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
export certain cells from excel to word
Hi All, I am trying to export certain detail from excel to word on a click of
a button from excel, Here is my code. I know I am missing something, Can you please guide my way thought this. Private Sub Export_Click() Dim objWord As Object 'Word Object Dim strTemplateName As String 'Template name Dim strPathTemplateName As String 'Path & Template Dim sWdFileName As String Set doc = objWord.Documents.Open(sWdFileName) strTemplateName = "TestTemplate.dot" strPathTemplateName = "C:\My Documents" & strTemplateName Set objWord = CreateObject("Word.Application") With objWord .ActiveDocument.bookmarks("Address").Range = Sheet2.Range("B4").Value .ActiveDocument.bookmarks("City").Range = Sheet2.Range("B5").Value .ActiveDocument.bookmarks("State").Range = Sheet2.Range("B6").Value .ActiveDocument.bookmarks("Zip").Range = Sheet2.Range("B7").Value End With objWord.Visible = True Set objDoc = Nothing Set objWord = Nothing End Sub Thanks in Advance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Export % from Excel to Word as % | Excel Programming | |||
Export from Excel to Word | Charts and Charting in Excel | |||
Export from Excel to Word | New Users to Excel | |||
export/copy excel cells to Word | Excel Discussion (Misc queries) | |||
export from excel to word | Excel Programming |