LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim Jim is offline
external usenet poster
 
Posts: 615
Default send information to word

I have written a macro in Excel which copies data from a work sheet then
automatically opens a specific file in word.

In the word file I have an AutoOpen macro which pastes the data then brings
up the save as dialog box.

I only want the macro in the word document to run once so once it has been
saved i want to delete the macros of permanently disable them. Is this
possible or is there a better way of pasting the excel data into a new sheet
say using a template?

This is the code in my Excel file:

Sheets("quotation").select
ActiveSheet.Unprotect
Range("A16:e321").select
Selection.Sort Key1:=Range("d16"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A1").select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Application.ScreenUpdating = True


Cells.Find(What:="5000000", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.select
ActiveCell.Offset(-1, -2).select
Range(Selection, Cells(1)).select
Selection.Copy
Dim wdApp As Word.Application, wdDoc As Word.Document

On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err.Number < 0 Then 'Word isn't already running
Set wdApp = CreateObject("Word.Application")
End If
On Error GoTo 0

Set wdDoc =
wdApp.Documents.Open(Worksheets("constants").Range ("A85").Value)

wdApp.Visible = True
wdApp.Activate
Application.CutCopyMode = False
Range("a1").select

End Sub

This is the code in my word file:

Sub autoopen()
'
' AutoOpen Macro
' Macro recorded 15/06/2007 by James Cowell
'
Selection.Paste
Dialogs(wdDialogFileSaveAs).Show
End Sub


 
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
Send date information from two cells to Outlook Calendar splodgey Excel Discussion (Misc queries) 0 August 6th 07 01:44 PM
Have Excel send information to another program? [email protected] Excel Programming 4 September 4th 06 02:52 AM
how do i can send a information of cell automaticaly via email? Rajani New Users to Excel 1 June 8th 06 10:59 PM
My send to in excel/word does not offer send as attachment Mstink Excel Discussion (Misc queries) 11 March 16th 06 02:49 PM
I would really like to send information to your marketing group Charlie Excel Programming 1 July 26th 05 06:31 PM


All times are GMT +1. The time now is 07:27 AM.

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

About Us

"It's about Microsoft Excel"