LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Getting a range from Excel into a Word document

Hello All,

I am trying to get a named range into a word document.....I have thi
code....

It creates a word document correctly with the right path however, ho
do i get the named range into the word document??

Any Ideas??

Thanks - Dani

Sub MakeWordFile()
' Creates Word document
Dim WordApp As Object

On Error Resume Next
Application.ScreenUpdating = False

' Start Word and create an object
Set WordApp = CreateObject("Word.Application")
With WordApp
.Documents.Add
End With

' Determine the file name
SaveAsName = ThisWorkbook.Path & "\" & "volumeslast2weeks.doc"

' Select worksheet
Sheets("NETWORKS").Select




' Information from worksheet
Set Data = Sheets("Networks").Range("Changes")






' Send commands to Word
With WordApp
With .Selection
'?????SOMETHING TO GO HERE TO IMPUT THE DATA IN RANG
"Changes" or Variable Set Data????

End With
End With

' Save the Word file and close it
With WordApp
.ActiveDocument.SaveAs Filename:=SaveAsName
.ActiveWindow.Close
' Kill the object
.Quit
End With

Set WordApp = Nothing

' Reset status bar
Application.StatusBar = ""
MsgBox "Completed and saved " & ThisWorkbook.Path
End Su

--
Message posted from http://www.ExcelForum.com

 
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
2007 - link named excel range to word document Karin Excel Discussion (Misc queries) 0 February 8th 10 09:36 PM
Inserting data into Word document by a range of dates from Excel spreadsheet Gordon[_6_] New Users to Excel 3 July 29th 08 08:22 PM
convert excel document to word document (not a picture) frendabrenda1 Excel Discussion (Misc queries) 2 October 6th 06 03:55 PM
Can you transform an excel document into a word document? Tammy Excel Discussion (Misc queries) 1 May 19th 05 03:23 PM
Inserting selected range into Word document Ed Stevens[_2_] Excel Programming 2 October 15th 03 03:35 PM


All times are GMT +1. The time now is 06:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"