Excel and Word Automation
Excel and Word Automation
(OP)
I am writing a macro in excel that will copy a specifed range of cells, open a document and paste the cells at a specified bookmark in the document.
On copying the cells, and then selecting the bookmark and giving the selection.paste command, it gives an error "The object does not support this method"
Can someone provide a solution?
On copying the cells, and then selecting the bookmark and giving the selection.paste command, it gives an error "The object does not support this method"
Can someone provide a solution?





RE: Excel and Word Automation
RE: Excel and Word Automation
Did you work this macro out ? I'd like a copy if you did...sounds usefull
Thanks,
kook
RE: Excel and Word Automation
Sub datatransfer()
' Word document to insert Excel data into
file2$ = "C:\Data\Doc1.doc"
chan = DDEInitiate("WinWord", file2$)
Set rangeToPoke = Worksheets("Sheet1").Range("A1:C5")
' BookMark3 is the name of the BookMark where data will be placed
Application.DDEPoke chan, "BookMark3", rangeToPoke
Application.DDETerminate chan
End Sub
This code works for Office 97 in Windows ME. The preceding code will place the data in the range A1:C5 of the active workbook into an existing bookmark called "BookMark3" in an existing document "Doc1.doc" located in a "Data" folder on the C drive.
The problem with this code is that every time you execute the macro, you get a "YesNO" messagebox asking you if want to start the application WinWord.exe even if it is already running.
RE: Excel and Word Automation
RE: Excel and Word Automation
This is preferable to a general macro.
Beyond that, the need has to be defined precisely for a useful specific macro.
RE: Excel and Word Automation
who knows how to use an excel macro to launch an analysis program?
i have to perform a parametric structural analysis, and i intend to create an excel sheet whith all the parameters data, with a macro that activates the structural program at each iteration and also copies the output at each step
is it too tricky?
i am new to vba, hope i do not bother you!
thanks
RE: Excel and Word Automation
You should start a new thread for your question.
What is the analysis program? Is it a standalone exe file or is it incorporated in your workbook? This should be pretty simple to do using VBA. We will need more information on how the analysis program is run.
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.