loading an Office Theme through automation

J

joestern

I can run the following Excel VBA actions successfully from Excel 2007:

Sub SaveAndLoad()
With ActiveWorkbook.Theme.ThemeColorScheme
.Save "C:\test.xml"
.Load "C:\test.xml"
End With
End Sub

However, when I try to automate this very similar code from PowerPoint 2007,
it fails.

Sub ApplyThemeToEmbeddedExcelChart
Dim xlWBK as Excel.Workbook
set xlWBK = ActivePresentation.Slides(1).Shapes(1).OLEFormat.Object
'this line works:
xlWBK.ActiveChart.ApplyDataLabels xlDataLabelsShowValue
'this line fails:
xlWBK.Theme.ThemeColorScheme.Load "C:\test.xml"
End Sub

The error I get is Run-time error '-2147024891 (80070005))':
Access denied. You do not have enough privileges to complete this operation.

Does anyone have any insight? I'd be ever so grateful!

Thanks,

Joe
Philadelphia, PA
 

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