M
Miguel Velez
I got a Ms Word document with an embedded Ms Excel
workbook. I've written some VBA code to open the workbook
but when it runs a dialog comes up warning me that the
workbook contains macros and whether I want them enabled.
Since the next thing the code does is run the macro
contained by the embedded workbook, the answer is "Yes".
The code looks like this:
Dim xl As Object
With ActiveDocument.Shapes("Object 42").OLEFormat
.Activate
Set xl = .Object
End With
xl.UpdateChartFromPEST
Set xl = Nothing
I've tried adding this line after the ".Activate" line:
SendKeys "%y"
but it doesn't work. Does anyone know how I can select
from code the "Yes" button in the dialog?
Thanks in advance.
Miguel
workbook. I've written some VBA code to open the workbook
but when it runs a dialog comes up warning me that the
workbook contains macros and whether I want them enabled.
Since the next thing the code does is run the macro
contained by the embedded workbook, the answer is "Yes".
The code looks like this:
Dim xl As Object
With ActiveDocument.Shapes("Object 42").OLEFormat
.Activate
Set xl = .Object
End With
xl.UpdateChartFromPEST
Set xl = Nothing
I've tried adding this line after the ".Activate" line:
SendKeys "%y"
but it doesn't work. Does anyone know how I can select
from code the "Yes" button in the dialog?
Thanks in advance.
Miguel