Opening inbedded Excel workbook

M

Miguel Velez

I'm trying to open an Ms Excel workbook which is inbedded
in an Ms Word document from am Ms Word macro. I use the
following code to open the workbook:

Dim xl As Object
With ActiveDocument.Shapes("Object 42").OLEFormat
.Activate
Set xl = .Object
End With
xl.UpdateChartFromPEST
Set xl = Nothing

Once the workbook is opened, I want to run
the "UpdateChartFromPEST" macro contained by the Excel
workbook (as you can see above). But when the workbook is
attempted to be opened, I get asked by Ms Excel if I want
to open a workbook that contains macros. I want to write
code, somewhere, that will automatically select the "Yes"
button. I've tried using the SendKeys statement in the Ms
Word macro but it hasn't worked.

Does anyone know how I can perform this task from code?

Miguel
 
P

Perry

In Excel, adjust the Security setting as follows:

Tools | Macros | Security
In security dialog tab: Trusted Publishers
Check the checkbox: Trust Access to Visual Basic project.

See whether this helps.

Krgrds,
Perry
 
M

Miguel Velez

Perry,

I can't see a Security option in the Tools | Macros menu.
I'm using Excel 97; is this option available in that
version? Is it located somewhere else?

Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top