I got a Word document with an inbedded Excel spreadsheet.
I want to run a macro that reads a text file and updates
the data contained in the inbedded Excel spreadsheet.

I've written an Excel macro (which is contained within the
inbedded Excel spreadsheet) that does the updating. I now
need to write a Word macro that will run this Excel macro.

Is there any way I can do that?

Or is there another approach?

Miguel

Re: Running Excel macros from Word by Perry

Perry
Thu Jan 08 11:26:02 CST 2004

Can be done.

In Excel workbook "c:\temp\RunMacro.xls" I've entered following macro
in ThisWorkbook module:

Public Sub MyMacro(SomeString As String)
MsgBox SomeString
End Sub

The above workbook is embedded in a Word document as an Inlineshape.
Macro in a standard module in same Word document:
Sub Test()
Dim xl As Object
With ActiveDocument.InlineShapes(1).OLEFormat
.Activate
Set xl = .Object
End With
xl.mymacro "Hello World"
Set xl = Nothing
End Sub

Krgrds,
Perry

"Miguel Velez" <anonymous@discussions.microsoft.com> wrote in message
news:032301c3d568$7b4aca80$a601280a@phx.gbl...
> I got a Word document with an inbedded Excel spreadsheet.
> I want to run a macro that reads a text file and updates
> the data contained in the inbedded Excel spreadsheet.
>
> I've written an Excel macro (which is contained within the
> inbedded Excel spreadsheet) that does the updating. I now
> need to write a Word macro that will run this Excel macro.
>
> Is there any way I can do that?
>
> Or is there another approach?
>
> Miguel