View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
joestern joestern is offline
external usenet poster
 
Posts: 1
Default loading an Office Theme through automation

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.O bject
'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